Moss' blog
https://banay.me/
Recent content on Moss' blogHugo -- gohugo.ioen-usMoss EbelingTue, 30 Jun 2020 21:01:00 +1000Debugging some GANs
https://banay.me/debugging-a-gan/
Tue, 30 Jun 2020 21:01:00 +1000https://banay.me/debugging-a-gan/Introduction Recently I’ve been motivated to investigate generative models, of which the most popular is currently GANs. The best way I could think of learning about GANs in deeper detail (since I’m interested in tweaking them later in some applied cases) is to implement them myself, and solve the bugs and issues that arise in practice myself.
In this article I’ll use PyTorch and a framework that helps simplify training called PyTorch Lightning (Falcon, 2019).Visualising XBTUSD orderbooks
https://banay.me/xbtusd-orderbook-vis/
Sun, 31 May 2020 19:51:00 +1000https://banay.me/xbtusd-orderbook-vis/Introduction Orderbooks are tables that show the immediate and public supply and demand of instruments that trade on financial exchanges. They collate orders that specify the direction, price and volume at which a party wants to trade an instrument.
I have collected several months of orderbook snapshots from the perpetual XBTUSD contract on the cryptocurrency derivatives exchange BitMEX. Here I want to show some simple visualisations that give more detail into the drivers of particular changes in price that are not observable with more common candlestick charts.(Double) Q-learning and maximisation bias
https://banay.me/maximisation-bias-q-learning/
Thu, 30 Apr 2020 16:36:00 +1000https://banay.me/maximisation-bias-q-learning/Introduction In this article we’ll review Q-learning and walk through a subtle improvement that leads to Double Q-learning and better policies. We’ll then look at this in action, and compare the two methods on a toy problem.
Reinforcement learning refresher In this article I assume a familiarity with reinforcement learning and the standard Q-learning algorithm. In this section I’ll provide a brief review of the basic terminology, which you can feel free to skip if you’re comfortable in doing so.Websockets with Elm using ports
https://banay.me/websockets-in-elm/
Sat, 14 Mar 2020 18:18:00 +0100https://banay.me/websockets-in-elm/Introduction Recently I came across the need for an easy UI to display information coming from a websocket. A niche option but one I’ve had a pleasant experience with previously is Elm, a functional language designed specifically for web applications.
Previously, the standard approach for connecting to a websocket was through the elm/websocket package, has been recently broken after some of the recent changes to the Elm language. In the mean time while the package and others are being updated, there’s a simple workaround by using another Elm feature called ports which allow for interop with JavaScript code.Let's write a Neural Arithmetic Logic Unit
https://banay.me/nalu/
Tue, 14 Jan 2020 17:46:00 +1100https://banay.me/nalu/Introduction A few months ago I read this paper from DeepMind that addressed a simple choice of architecture to encourage sensible weights in neural networks when solving problems that at the core are simple arithmetic. Despite the continued hype surrounding neural networks and deep learning in general, some simple problems like this are difficult to generalise past the regions used in a training set.
XOR was a famously difficult problem that stunted developments in perceptrons (the predecessors to what has become neural networks) until Marvin Minsky and Seymour Papert addressed it by applying composition to the model.Playing Tic-tac-toe with minimax in Python
https://banay.me/tic-tac-toe-minimax/
Sun, 19 May 2019 14:36:00 +1000https://banay.me/tic-tac-toe-minimax/Introduction In this article we will explain the minimax algorithm. We’ll cover game trees, the minimax algorithm itself and a simple implementation in Python. We’ll also review some popular extensions that speed up or improve upon the actions taken by minimax.
Game trees For games with perfect information, we can model the entire play-space using a directed graph called game tree. A game tree simply illustrates all possible ways in which a game may play out.Auto-regressive time series in R
https://banay.me/auto-regressive-time-series-in-r/
Tue, 26 Feb 2019 11:48:00 +1100https://banay.me/auto-regressive-time-series-in-r/Introduction In this post we’ll go over auto-regressive time series. What they are, what they look like and some properties they exhibit. Throughout the post we’ll use small snippets of R to plot processes and visualisations.
What are autoregressive time series? An auto-regressive time series is a stochastic process in which future values are modelled by a linear combination of some number of previous values of the same process. In other words, a series which is regressed on itself in order to find coefficients that relate its past values to its future values.Hyperparameter selection with T-tests
https://banay.me/hyperparameter-t-test/
Sun, 11 Nov 2018 19:14:00 +0100https://banay.me/hyperparameter-t-test/Introduction One of the most important steps in developing a model for machine learning is tuning hyperparameters to ensure it generalises to unseen data. A model that fits the training set well but performs poorly on anything else is useless, so care should be taken in ensuring that in-sample performance characteristics of a model are representative of real world performance also. The most simple of these methods is of course using a holdout set, which allows for an easy way to estimate performance on out-sample data but when used as part of the model iteration process, is usually is also overfit to some degree.Fast keyword matching with the Aho-Corasick algorithm
https://banay.me/aho-corasick/
Wed, 22 Aug 2018 19:20:00 +1000https://banay.me/aho-corasick/Introduction In this post we’ll look at the problem of keyword matching including a number of approaches, applications and the Aho-Corasick algorithm.
Statement of problem To begin, let’s define the keyword searching problem.
Given a list of strings \(K = [s_1, \ldots, s_n]\) (called keywords) and a (usually) much longer string \(C\) (called the corpus) count the number of times each keyword appears in the corpus.
Let \(|s_i|\) be the length of the \(i\) - th keyword and let \(m\) be the length of the corpus \(C\).