This character level Markov chain generates text in the style of "The Picture of Dorian Gray" by Oscar Wilde. The model is trained by calculating the transition probabilities seen within the text and then is used to generate new text by randomly sampling the next character based on the transition probabilities from the previous character sequence. You can check out the code for this project here.
I put together this ticket to ride simulation to explore the game and develop an AI to play it. The game is played by selecting routes between cities and collecting the corresponding coloured train cards to claim the route. The game is won by having the most points at the end of the game. You can check out the code for simulating the game here.
I made this site to track Spiking Neural Network (SNN) Benchmarks using results from leading research papers. This project is maintained by myself and was conceived of from finding a lack of such a comparison tool whilst I explored this field.
Ask LLMs was a small project I started to explore a forum style interface for asking questions to a large language model. The thinking was that often when trying to find the answer to a specific question I find forums the most useful. This is because I can skim read the answers and quickly find the one which answers the aspect of the question which I am most interested in. The typical LLM interface is a single multi-paragraph answer, meaning that the question needs to be well composed to get the answer you are looking for. This project is a minimal implementation of this interface. It can be run locally following the instructions in the repository. If anyone has any thoughts on how to improve this project I would love to hear them, also feel free to fork it and develop the idea further!
Othello Bot
Introduction
I've always enjoyed othello, so I figured it would be a great game to apply various ML algorithms to, from a simple greedy search algorithm to training a reinforcement learning (RL) agent.
Othello Rules
The game starts with four discs placed in the center of the board in a square pattern. Each player takes turns placing a disc of their color on the board. A move is valid if it captures at least one of the opponent's discs. Capturing is done by trapping one or more of the opponent's discs between the disc just placed and another disc of the current player's color. The captured discs are then flipped to the current player's color. The game ends when neither player can make a valid move. The player with the most discs of their color on the board at the end of the game wins.
Play the game
In the javascript game below you can play against the following five different algorithms of increasing complexity
Random Choice
As the name suggests this opponent uses random choices to select its move, don't expect any impressive play here.
Greedy
This greedy opponent chooses the move which flips the most tiles. Whilst tempting, this sort of short term thinking also won't lead to very impressive play.
Greedy Tuned
Like the previous greedy opponent this algorithm seeks to maximise the immediate board state. However unlike the previous greedy opponent the immediate board state is combined with additional bonuses for certain strategic tiles. This weights in favour of edges and corners, whilst down weighting tiles adjacent to edges.
Minimax
The minimax is a tree search algorithm that explores all possible sequences, up to some pre-defined depth. The name arises from the definition of the optimal move as the maximised value relative to the players choice and minimised relative to the opponent's actions. The depth here is set to 4, you will notice that even this relatively shallow search becomes very computationally demanding. More efficient searches exist with algorithms such as alpha-beta pruning and principal variation search.
Minimax Tuned
Like the previous minimax opponent this opponent uses the minimax algorithm to search for the optimal move. However unlike the previous minimax opponent the board value is not just the number of tiles owned, but also weighted by the tile values.
I am working to include more options to the online version, using agents trained with RL techniques such as Q-Learning.
Implementation
If you're curious to see how I implemented this game and the opponents you can take a look at the code here.
Cleanplate
At cleanplate I was building our mobile app, which aimed to enable food influencers to share the carbon impact of the food they promote. Check out the app store page for more details. We decided to stop working on this project due to a lack of time for it between me and my friends Tom and Rory.