mscroggs.co.uk
mscroggs.co.uk

subscribe

Blog

Visualising MENACE's learning

 2019-12-27 
In tonight's Royal Institution Christmas lecture, Hannah Fry and Matt Parker demonstrated how machine learning works using MENACE.
The copy of MENACE that appeared in the lecture was build and trained by me. During the training, I logged all the moved made by MENACE and the humans playing against them, and using this data I have created some visualisations of the machine's learning.
First up, here's a visualisation of the likelihood of MENACE choosing different moves as they play games. The thickness of each arrow represented the number of beads in the box corresponding to that move, so thicker arrows represent more likely moves.
The likelihood that MENACE will play each move.
There's an awful lot of arrows in this diagram, so it's clearer if we just visualise a few boxes. This animation shows how the number of beads in the first box changes over time.
The beads in the first box.
You can see that MENACE learnt that they should always play in the centre first, an ends up with a large number of green beads and almost none of the other colours. The following animations show the number of beads changing in some other boxes.
MENACE learns that the top left is a good move.
MENACE learns that the middle right is a good move.
MENACE is very likely to draw from this position so learns that almost all the possible moves are good moves.
The numbers in these change less often, as they are not used in every game: they are only used when the game reached the positions shown on the boxes.
We can visualise MENACE's learning progress by plotting how the number of beads in the first box changes over time.
The number of beads in MENACE's first box.
Alternatively, we could plot how the number of wins, loses and draws changes over time or view this as an animated bar chart.
The number of games MENACE wins, loses and draws.
The number of games MENACE has won, lost and drawn.
If you have any ideas for other interesting ways to present this data, let me know in the comments below.
                  ×1      
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
@(anonymous): Have you been refreshing the page? Every time you refresh it resets MENACE to before it has learnt anything.

It takes around 80 games for MENACE to learn against the perfect AI. So it could be you've not left it playing for long enough? (Try turning the speed up to watch MENACE get better.)
Matthew
                 Reply
I have played around menace a bit and frankly it doesnt seem to be learning i occasionally play with it and it draws but againt the perfect ai you dont see as many draws, the perfect ai wins alot more
(anonymous)
                 Reply
@Colin: You can set MENACE playing against MENACE2 (MENACE that plays second) on the interactive MENACE. MENACE2's starting numbers of beads and incentives may need some tweaking to give it a chance though; I've been meaning to look into this in more detail at some point...
Matthew
                 Reply
Idle pondering (and something you may have covered elsewhere): what's the evolution as MENACE plays against itself? (Assuming MENACE can play both sides.)
Colin
                 Reply
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "sixa-y" backwards in the box below (case sensitive):

Archive

Show me a random blog post
 2024 

Feb 2024

Zines, pt. 2

Jan 2024

Christmas (2023) is over
 2023 
▼ show ▼
 2022 
▼ show ▼
 2021 
▼ show ▼
 2020 
▼ show ▼
 2019 
▼ show ▼
 2018 
▼ show ▼
 2017 
▼ show ▼
 2016 
▼ show ▼
 2015 
▼ show ▼
 2014 
▼ show ▼
 2013 
▼ show ▼
 2012 
▼ show ▼

Tags

edinburgh mathslogicbot plastic ratio signorini conditions binary guest posts bodmas royal institution the aperiodical gaussian elimination turtles correlation reddit 24 hour maths arithmetic dates big internet math-off pascal's triangle stirling numbers realhats london national lottery dragon curves raspberry pi datasaurus dozen databet preconditioning manchester dinosaurs quadrilaterals estimation curvature probability recursion advent calendar hyperbolic surfaces manchester science festival live stream machine learning speed triangles golden ratio ucl squares numerical analysis hannah fry wool martin gardner logo bubble bobble weak imposition javascript oeis puzzles numbers pac-man data books coins final fantasy programming matrix multiplication cambridge pi approximation day game show probability matrices weather station game of life ternary world cup newcastle asteroids christmas card a gamut of games boundary element methods errors noughts and crosses craft accuracy misleading statistics folding tube maps bempp sport fonts news php trigonometry computational complexity cross stitch inline code go menace dataset folding paper gather town pizza cutting games light polynomials talking maths in public runge's phenomenon video games countdown palindromes christmas error bars simultaneous equations platonic solids tmip captain scarlet chess sound matt parker chalkdust magazine crossnumber sorting pi map projections fractals latex finite element method sobolev spaces flexagons frobel inverse matrices graph theory mean python approximation radio 4 propositional calculus fence posts determinants chebyshev hats geogebra finite group logs wave scattering london underground electromagnetic field geometry anscombe's quartet nine men's morris statistics harriss spiral braiding stickers youtube standard deviation pythagoras matrix of minors crochet european cup zines football hexapawn golden spiral mathsjam rugby people maths exponential growth interpolation reuleaux polygons data visualisation gerry anderson matrix of cofactors tennis graphs royal baby convergence mathsteroids rhombicuboctahedron draughts logic phd

Archive

Show me a random blog post
▼ show ▼
© Matthew Scroggs 2012–2024