<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>algorithm on Tom Roth</title><link>https://tomroth.dev/tags/algorithm/</link><description>Recent content in algorithm on Tom Roth</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sun, 01 Dec 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://tomroth.dev/tags/algorithm/index.xml" rel="self" type="application/rss+xml"/><item><title>Backprop and topological sorting</title><link>https://tomroth.dev/backprop-toposort/</link><pubDate>Sun, 01 Dec 2019 00:00:00 +0000</pubDate><guid>https://tomroth.dev/backprop-toposort/</guid><description>Neural networks need to update their weights with respect to a loss function. Rather than compute these weight updates manually, today we usually use automatic differentiation packages and tools. We call these autodiff systems.
To do their job, autodiff systems construct computational graphs of the function they’re trying to find the gradient of. These computational graphs are key to backpropagation. I won’t go into how these graphs are constructed here.</description></item><item><title>Let's build a DQN: neural network architectures</title><link>https://tomroth.dev/dqn-nnet/</link><pubDate>Thu, 01 Nov 2018 00:00:00 +0000</pubDate><guid>https://tomroth.dev/dqn-nnet/</guid><description>After building the basic DQN, I started trying some different neural network architectures. I found vastly different results between them.
Spoiler: more complex doesn&amp;rsquo;t equal better. Almost the opposite.
Here are some results for the rewards obtained in each episode. I trained these models on cartpole-v1. Each was trained for 1000 episodes.
Disclaimer: I did only one run with each architectures. I kept other hyperparameters the same as the previous post, but there are likely some interaction effects unaccounted for.</description></item><item><title>Let's build a DQN: simple implementation</title><link>https://tomroth.dev/dqn-simple/</link><pubDate>Wed, 31 Oct 2018 00:00:00 +0000</pubDate><guid>https://tomroth.dev/dqn-simple/</guid><description>Click the image above to see the source code.
Last time, we established some theory for our DQN. Now it’s time to implement it.
We won’t build a full DQN from the DeepMind paper, not yet. Instead we’ll build a simplified version. I call it the basic DQN.
The basic DQN is the same as the full DQN, but missing a target network and reward clipping. We’ll get to that in the next post.</description></item><item><title>Let's build a DQN: basics</title><link>https://tomroth.dev/dqn-basics/</link><pubDate>Tue, 23 Oct 2018 00:00:00 +0000</pubDate><guid>https://tomroth.dev/dqn-basics/</guid><description>In February 2015, Google Brain published a paper combining deep neural networks and reinforcement learning for the first time - called DQN (deep q-network). It was a landmark moment.
DQN was the first algorithm that could successfully play a wide range of Atari games. Other algorithms at the time could perform well at a single game but couldn’t generalise across games. Impressively, DQN was able to perform above human level at a range of Atari games using only the screen pixels as input.</description></item><item><title>Sarsa, expected sarsa and Q-learning on the OpenAI taxi environment</title><link>https://tomroth.dev/sarsa-qlearning/</link><pubDate>Mon, 08 Oct 2018 00:00:00 +0000</pubDate><guid>https://tomroth.dev/sarsa-qlearning/</guid><description>In this post, we&amp;rsquo;ll see how three commonly-used reinforcement algorithms - sarsa, expected sarsa and q-learning - stack up on the OpenAI Gym Taxi (v2) environment.
Note: this post assumes that the reader is familiar with basic RL concepts. A good resource for learning these is the textbook by Sutton and Barto (2018), which is freely available online.
Sarsa, Expected Sarsa and Q-Learning Link to heading So, what are these algorithms?</description></item><item><title>Building a nearest neighbour classifier in Python</title><link>https://tomroth.dev/nearest-neighbour/</link><pubDate>Sat, 26 Aug 2017 00:00:00 +0000</pubDate><guid>https://tomroth.dev/nearest-neighbour/</guid><description>The nearest neighbour classifier is a very simple algorithm for image classification. While not used much in practice, it is simple to implement and it helps to gain a deeper understanding of the problems in image classification.
Just like other classifiers, if we give the nearest neighbour classifier an image, it&amp;rsquo;ll try and find its closest match. We &amp;ldquo;train&amp;rdquo; the classifier by giving it a large collection of images that it allowed to search through to find matches.</description></item><item><title>Simulating the multi-armed bandit problem</title><link>https://tomroth.dev/bandit/</link><pubDate>Wed, 24 May 2017 00:00:00 +0000</pubDate><guid>https://tomroth.dev/bandit/</guid><description>Machine learning can be split up into many subfields. One of these subfields growing in relevance is reinforcement learning.
One of the core problems in reinforcement learning is the multi-armed bandit problem. This problem has been well studied and is commonly used to explore the tradeoff between exploration and exploitation integral to reinforcement learning.
To illustrate this tradeoff and to visualise different ways of solving the multi-armed bandit problem, I created a simulation using the JavaScript library d3.</description></item><item><title>Understanding Kadane’s solution to the maximum subarray problem</title><link>https://tomroth.dev/kadane/</link><pubDate>Tue, 09 May 2017 00:00:00 +0000</pubDate><guid>https://tomroth.dev/kadane/</guid><description>There is something called the maximum subarray problem, and it goes something like this.
You are given an array of numbers: something like 3,5,-2,-1,5,3,1,-4,-6,5. Your job is to come up with the subarray with the highest sum.
For this example it would be the subarray [3,5,-2,-1,5,3,1], which has a sum of 14. No other subarray gives a higher sum.
Let&amp;rsquo;s look at a few more:
The sequence -3,-3,-2,-4,-2,-5,-4 has the highest sum being -2, given by the subarray [-2].</description></item></channel></rss>