Guest post by Dan Wallace: A machine learning system playing a game to super-human levels, using only plastic boxes and beads

Hi, I’m Dan Wallace, a PhD student at the Institute of Sound and Vibration Research in Southampton, UK. I’m interested in lots of areas of acoustics — here I am working on a prototype 3D audio system in one of our anechoic chambers, as part of my Masters project.

Dan inside an anechoic chamber. Photo credit: Dan Wallace

Dan inside an anechoic chamber. Photo credit: Dan Wallace/University of Southampton

Today though, I’d like to talk about a machine I’ve designed, the CHocolate Oriented Machine-learning Processor (or CHOMP for short). CHOMP is a machine learning system designed to play a table-top game to super-human levels, with no silicon chips, no neural networks, not even any electricity… Introducing CHOMP!

Chomp's hardware: A bunch of plastic boxes. Photo credit: Dan Wallace

Chomp’s hardware: A bunch of plastic boxes. Photo credit: Dan Wallace

This pile of plastic boxes has triumphed over PhD’s, employees of Google DeepMind, numerous seven-year olds and our University Vice-Chancellor – all it takes is a little training.

First, let’s introduce the game we’re playing. Like all the best games, our game is played with a big bar of chocolate, but for sustainability (of our waistlines), ours is 3D printed. By the way, NGCM stands for Next Generation Computational Modelling. NGCM is the Centre for Doctoral Training who are supporting me throughout my PhD with training, equipment and funding.

3D-printed chocolate bar. Photo credit: Dan Wallace

3D-printed chocolate bar. Photo credit: Dan Wallace

Players alternate taking bites out of the bar of chocolate from the bottom right corner, and the aim of the game is to avoid the poisoned square in the top left corner. Bites can be as big as you like, provided you follow one simple rule: Pick a square, remove it, then remove all squares below it and to the right.

Animated gif showing a game of chomp. Photo credit: Dan Wallace

A game of chomp. Photo credit: Dan Wallace

Let’s look a little closer at CHOMP to see how the machine makes decisions. Each of the 33 boxes which make up CHOMP is labelled with a picture of the chocolate bar in a different state, and in every box are some coloured beads.

A glance inside the inner workings of Chomp: one of Chomp's plastic boxes with colored beads inside. Photo credit: Dan Wallace

A glance inside the inner workings of Chomp: one of Chomp’s plastic boxes with colored beads inside. Photo credit: Dan Wallace

Each different coloured bead represents a different sized bite out of the chocolate bar – remember the rule: Pick a square, remove it, then remove all squares below it and to the right. When playing against people, we provide a handy map to show which coloured bead refers to which square. CHOMP lacks the dexterity to choose moves for itself, so we let players help by picking a bead at random from the correct box.

Which color bead corresponds to which move? Showing the Chomp bar and a map. Photo credit: Dan Wallace

Which color bead corresponds to which move? Photo credit: Dan Wallace

As we play the game, we record the moves which are played by each player by placing the chosen bead on top of the box it came from. At the end of the game, we have two lists of moves, one of which ended in a loss (in this case, made by the human) and another which ended in a win (for CHOMP!)

Documenting a single game of Chomp. Displaying the moves that got chosen by the human and "the machine". Photo credit: Dan Wallace

Documenting a single game of Chomp. Displaying the moves that got chosen by the human and “the machine”. Photo credit: Dan Wallace

This information about good and bad moves enables us to train the machine.

Every losing move is removed from the game, decreasing the probability that CHOMP would choose that move, from that position, in the next game. Every winning move is returned to its box, with two extra beads, increasing the probability that CHOMP will make good moves. Through this process alone, called “Reinforcement Learning”, CHOMP learns the winning strategy.

Showing boxes and beads: Winning moves are reinforced by adding more beads the color of the winning move. Photo credit: Dan Wallace

Winning moves are reinforced by adding more beads the color of the winning move. Photo credit: Dan Wallace

And it works! We have recorded every game we’ve played with CHOMP since spring of 2018, marking games off in sets of seven. Human wins are marked in orange from the top of a set, and CHOMP wins are marked in green from the bottom. At the start of each tournament (the leftmost column in each chart) we reset CHOMP so that every bead in each box is equally likely to be chosen. The results show that while CHOMP might win a game by chance, six times out of seven, humans win. Over time though, CHOMP gets stronger and stronger, winning five or six games out of seven after around 70 games worth of training.

Charts documenting how the probability of winning against Chomp decreases the more Chomp has been trained. Photo credit: Dan Wallace

Documenting how the probability of winning against Chomp decreases the more Chomp has been trained. Photo credit: Dan Wallace

We usually give our opponents a Cadbury’s Chomp bar as a prize for beating the machine. If they lose, we still give them chocolate as a thank-you gift for helping to train up CHOMP. We are #notsponsored by Cadbury’s yet!

Showing a pile of Cadbury bars. If you are lucky you win a Cadbury bar when winning against Chomp! #notsponsored by Cadbury (yet?). Photo credit: Dan Wallace

If you are lucky you win a Cadbury bar when winning against Chomp! #notsponsored by Cadbury (yet?). Photo credit: Dan Wallace

The beauty of CHOMP is that it is simple enough for a five-year-old to play, but powerful enough to surprise a professor. We’ve taken CHOMP to schools, science centres, university events and academic conferences, receiving some brilliant feedback from our defeated opponents. I’ll leave you with some quotes:

“So often, communication about AI and technology centres on the amazing tech, this game removes all that and shows how these machines operate beneath the algorithm!”

“Great presentation and concept. I loved seeing the “analogue” version of something so often thought of as digital!”

“Very interesting, it tears apart the fear of AI, because it’s just plastic boxes!”

Chomp on a winner's podium in a large arena (rank 2 and 3 are empty). Photo credit: Dan Wallace

Chomp on a winner’s podium. Photo credit: Dan Wallace

CHOMP is fully open-source, and instructions on how to make your own set can be found at www.github.com/dw-ngcm/chomp. If you’re running an event and you’d like CHOMP to feature, please contact me at D.Wallace@soton.ac.uk.

Taylor column in a rotating tank

For both of my tank experiment projects, in Bergen and in Kiel, we want to develop a Taylor column demonstration. So here are my notes on the setup we are considering, but before actually having tried it.

Since water under rotation becomes rigid, funny things can happen. For example if a current in a rotating system hits an obstacle, even if the obstacle isn’t high at all relative to the water depth, the current has to move around the obstacle as if it reached all the way from the bottom to the surface. This can be shown in a rotating tank, so of course that’s what we are planning to do!

We are following the Weather in a Tank instructions:

  • rotating our tank at 5rpm with the obstacle in the water until solid body rotation is reached (We know that solid body rotation is reached if paper bits distributed on surface all rotate at same rate as the tank).
  • change the rotation rate a little (they suggest as little as -0.1 rpm) so water moves relative to tank and obstacle, i.e. we have created a current flowing in the rotating system.

As the current meets the obstacle, columns of water have to move around the obstacle as if it went all the way from the bottom to the surface. This is made visible by the paper bits floating on the surface that are also moving around the area where the obstacle is located, even though the obstacle is far down at the bottom of the tank and there is still plenty of water over it.

In the sketch below, the red dotted line indicates a concentric trajectory in the tank that would go right across the obstacle, the green arrows indicate how the flow is diverted around the Taylor column that forms over the obstacle throughout the whole water depth.

Or at least that’s what I hope will happen! I am always a little sceptical with tank experiments that require changing the rotation rate, since that’s what we do to show both turbulence and Ekman layers, neither of which we want to prominently happen in this case here. On the other hand, we are supposed to be changing the rotation rate only very slightly, and in the videos I have seen it did work out. But this is an experiment that is supposedly difficult to run, so we will see…

I also came across about a super cool extra that Robbie Nedbor-Gross and Louis Dumas implemented in this demo: a moving Taylor column! when the obstacle is moved, the Taylor column above it moves with it. Check out their video, it is really impressive! However I think implementing this feature isn’t currently very high on my list of priorities. But it would be fun!

Rossby waves in a rotating tank — three different demonstrations

For both of my tank experiment projects, in Bergen and in Kiel, we want to develop a Rossby wave demonstration. So here are my notes on three setups we are considering, but before actually having tried any of the experiments.

Background on Rossby waves

I recently showed that rotating fluids behave fundamentally differently from non-rotating ones, in that they mainly occur in the horizontal and thus are “only” 2 dimensional. This works really well as long as several conditions are met, namely the water depth can’t change, nor can the rotation of the fluid. But this is not always the case, so when either the water depth or the rotation does change, the flow still tries to conserve potential vorticity and stay 2 dimensional, but now displays so-called Rossby waves.

Here are different setups for Rossby wave demonstrations I am currently considering.

Topographic Rossby wave

For a demonstration of topographic Rossby waves, we want the Coriolis parameter f to stay constant but have the depth H change. We use the instructions by geosci.uchicago.edu as inspiration for our experiment and

  • build a shallow ridge into the tank. They use an annulus and introduce the ridge at a random longitude, we could also build one across the center of the tank all the way to both sides to avoid weird things happening in the middle (or introduce a cylinder in the middle to mimic their annulus)
  • spin up the tank to approximately 26 rpm (that seems very fast! But that’s probably needed in order to create a parabolic surface with large height differences)
  • wait for it to reach solid body rotation (ca 10 min)
  • reduce rotation slightly, to approximately 23 rpm so the water inside the tank moves relative to the tank itself, and thus has to cross the ridge which is fixed to the tank
  • introduce dye upstream of the ridge, watch it change from laminar flow to eddies downstream of the ridge (they introduced dye at the inner wall of their annulus when the water was in solid body rotation, before slowing down the tank).

What are we expecting to see?

In case A, we assume that the rotation of the tank is slow enough that the surface is more or less flat. This will certainly not be the case if we rotate at 26rpm, but let’s discuss this case first, anyway. If we inject dye upstream of the obstacle, the dye will show that the current is being deflected as it crosses the ridge, to one direction as the water columns are getting shorter as they move up the ridge, then to the other direction when the columns are stretched going down the obstacle again. Afterwards, since the water depth stays constant, they would just resume a circular path.

In case B, however, we assume a parabolic surface of the tank, which we will have for any kind of fast-ish rotation. Initially, the current will move similarly to case A. But once it leaves the ridge, if it has any momentum in radial direction at all, it will overshoot its circular path, moving into water with a different depth. This will then again expand or compress the columns, inducing relative vorticity, leading to a meandering current and eddies downstream of the obstacle (probably a lot more chaotic than drawn in my sketch).

So in both cases we initially force the Rossby wave by topography at the bottom of the tank, but then in case B we sustain it by the changes in water depth due to the sloping surface.

My assessment before actually having run the experiment: The ridge seems fairly easy to construct and the experiment easy enough to run. However what I am worried about is the change in rotation rate and the turbulence and Ekman layers that it will introduce. After all, slowing down the tank is what we do create both turbulence and Ekman layers in demonstrations, and then we don’t even have an obstacle stuck in the tank. The instructions suggest a very slight reduction in rotation, so we’ll see how that goes…

Planetary Rossby waves on beta-plane

If we want to have more dramatic changes in water depth H than relying on the parabolic shape of the surface, another option is to use a rectangular tank and insert a sloping bottom as suggested by the Weather in a Tank group here. We are now operating on a Beta plane with the Coriolis parameter f being the sum of the tank’s rotation and the slope of the bottom.

Following the Weather in a Tank instructions, we plan to

  • fill a tank with a sloping bottom (slope approximately 0.5)
  • spin it at approximately 15 rpm until it reaches solid body rotation (15-20 minutes later)
  • place a dyed ice cube (diameter approximately 5 cm) in the north-eastern corner of the tank

What do we expect to see?

Ice cube and its trajectory (in red) on a sloping bottom in a rotating tank. Note: This sketch does not include the melt water water column!

Above is a simplified sketch of what will (hopefully!) happen. As the ice cube starts melting, melt water is going to sink down towards the sloping bottom, stretching the water column. This induces positive relative vorticity, making the water column spin cyclonically. As the meltwater reaches the sloping bottom, it will flow downhill, further stretching the water column. This induces more positive relative vorticity still, so the water column, and with it the ice cube, will start moving back up the slope until they reach the “latitude” at which the ice cube initially started. Having moved up the slope into shallower water, the additional positive vorticity induced by the stretching as the water was flowing down the slope has now been lost again, so rather than spinning cyclonically in one spot, the trajectory is an extended cycloid.

My assessment here (before having run it): I find this experiment a little more unintuitive because there are the different components of stretching contributing to the changes in relative vorticity. And from the videos I’ve seen, we don’t really get a clear column moving, but there are cyclonic eddies in the boundary layer that are shed. So I think this might be more difficult to observe and interpret. But I am excited to try!

Planetary Rossby wave on a cone (cyclical beta-plane?)

Following the Weather in a Tank instructions, we plan to also do the experiment as above but with cyclical boundary conditions, by using a cone in a cylindrical tank instead of a sloping bottom in a rectangular one.

The experiment is run in the same way as the one above (except they suggest a slightly slower rotation of 10 rpm). Physics are the same as before, except that now the transfer to reality should be a little easier, since we now have Rossby waves that can really run all the way around the pole. Also the experiment can be run for a longer time, since we don’t run into a boundary in the west if we are moving around and around the pole.

Ice cube and its trajectory (in red) on a cone in a rotating tank. Note: This sketch does not include the melt water column!

My assessment before actually having run the experiment: This shouldn’t be any more difficult to run, observe or interpret than the one above (at least once we’ve gotten our hands on a cone). Definitely want to try this!

Mariotte’s bottle: A nifty trick to control “reservoir height” in #dropphotography

In earlier posts on drop photography, you might have noticed that the reservoirs for the water that drops out and creates the beautiful liquid art has a weird cork on top, sealing it off, and a glass pipe sticking through. I’ve been wanting to explain what that’s all about for a while, but had to finally draw the picture for our liquid art workshop yesterday. So here we go!

Above, you see Wlodek adjusting something about it, and below is my sketch: A Mariotte’s bottle!

Very useful little thing to control pressure in a reservoir, and with pressure the “reservoir height” that is felt at the outflow, even though the reservoir height is actually changing. Basically, it’s a way to trick the system to feel a constant hydrostatic pressure.

Below on the left, you see the bottle when it has just been filled. A cork is sealing the top of the bottle, except that the inside and outside are connected by a pipe on top and the outflow at the bottom. Initially, the water level inside the top pipe and the bottle are the same and the pressure on both water surfaces is the atmospheric pressure.

As water flows out of the bottle, the water level in the bottle starts sinking. The head space (the air inside the bottle above the water) is sealed off from the outside, so as the water level sinks, its volume increases and its pressure (and thus the pressure on the water surface inside the bottle) sinks. In the middle plot below you see what happens then: The water level inside the pipe starts sinking to compensate for the missing volume inside the bottle.

Eventually, air starts bubbling out of the pipe into the headspace, and the water level inside the pipe is at the very bottom end of the pipe (right plot above). The pressure at this level (marked as A) is now atmospheric pressure, not only at the bottom of the pipe, but throughout the whole bottle. And the pressure at this level will continue to stay at atmospheric pressure levels for as long as the water level is still higher than the bottom end of this pipe. Occasionally, air will bubble out of there to compensate for further outflow.

So at the outflow, we always have the hydrostatic pressure relating to the height from B to A, no matter how much or little water there is in the reservoir. That means that all drop pictures in a series will have similar conditions, even as the reservoir is slowly getting empty. How cool is that? I love those kind of things. So simple, yet so efficient! :-)

Strong gusts of wind -> lots of energy transferred to the water -> wind waves with large amplitudes

We are still in the “interesting weather” period here in Kiel. Feels more like April than like September, but I am not complaining. I love the rapid change between dark clouds and blue skies and sunshine! Also I like how much more interesting wave pattern get if the wind comes in gusts rather than blowing just consistently the same.

Below, you see strong gusts of wind in the dark areas with the high surface roughness, but you also see that the small waves in the foreground have higher amplitudes and more pointy peaks than we usually see. Additionally, there are longer wave length waves coming in with crests more or less parallel to the images lower edge. And on top of all of this, there is the seagull’s wake. Can you still spot it even though it’s superposed on all the other waves?

Below, you clearly see the different wind strength in different areas. The shiny, flat surface with lower wind speeds, the rougher areas, and the comparatively short waves with large amplitudes in the foreground that show that there really is a lot of energy input over a relatively short fetch.

Below, in some regions we can also see hints of a checkerboard interference pattern of longer waves that were reflected at the sea wall, with the small, short wavelength waves superimposed.

Here is another look at these waves. I find them so fascinating!

And below is another strong gust of wind visible. And do you see the wave crests parallel to the edge of the floating part of the pier, created by that part of the pier moving in the waves?

And, just in case you didn’t know: At the end of the rainbow, you will find a … research ship!

Networking event for online science communicators tomorrow!

Anticipation is rising, just one more sleep and then it’s finally here! The networking event for online science communicators that Alice (see her blog, twitter, Instagram — see, we are serious about online science communication!) and I are organizing here in Kiel!

Check it out here and make sure to register if you want to join us, the address given on the website is unfortunately not where we’ll be!

#DropPhotography. Art or physics? Art AND physics!

When I take pictures of drops, they look like the picture below (which I showed in a blogpost yesterday), but I see tons of physics everywhere. Ring-shaped waves! Drops jumping up due to surface tension! Interference pattern of overlapping waves! And much more.

When Wlodek Brühl takes pictures of drops, they look like below. As an artist, to him it’s all about composition and inspiration and expression.

And when we work together, lots of interesting things happen. Do you want to see our art and science collaboration in action? Then come join one of our workshops at Digitale Woche Kiel, both on September 8th, 2019, one at 11-13 and the other at 13:30-15:30. Could you think of anything more inspiring to do on a Sunday? :-)

Favourite quote by Miriam Goldstein: “The ocean is strong and powerful and it likes to rip things up”

I am so lazy (or so efficient?) that even my doodles are multi purpose. Like this one, which is one of my three favourite ocean-related quotes I promised to illustrate to celebrate my blog’s 6th Birthday, and it’s also my submission to September’s #scicommchall on drawing the inspiration to your work.

Kim suggested I should draw Miriam Goldstein‘s “The ocean is strong and powerful and it likes to rip things up”, which I just love. For scientific context of this quote, check out Clark Richard’s blog post on Deep Sea News — a brilliant article on the (ocean) physics of the Ocean Cleanups System.

April weather in September (Great for #WaveWatching and cloud watching!)

Minutes after drawing the illustration to the “you are not a drop in the ocean, you are the ocean in a drop” quote I shared yesterday in the most beautiful sunshine, the sky started looking like this.

Luckily I had a nice spot from which I could observe what happened next…

…lots of drops. In the ocean. Or oceans in the drops? Who knows. Anyway, after just having done that drop drawing, I couldn’t very well get upset, and I love watching rain on water anyway.

Just look at all the wave rings, and the way drops are catapulted up again only through surface tension!

Here is a (first normal speed, then slow motion) video so you can appreciate it properly, too:

As the rain passed, I found it super impressive to watch the rain showers as they went down elsewhere.

Like over the mouth of Kiel fjord, and I am showing the same spot repeatedly in the following (with more or less the same view, you can use the buoy as point of reference).

I don’t know enough about meteorology to understand what’s going on there, but I can still appreciate the beauty of the rain cloud and how differently things look where it is propagating to (to the right) and where it has already left (to the left).

See how much lower the clouds on the right are, and clearly a different kind of cloud compared to the ones on the left?

At times, it got really dark.

And I watched this one cloud move, continuously raining.

Then there was a dry period of a couple of hours, and when I walked home, it looked like this: Again distinct areas with rain showers.

What I found also really interesting is the swimmer’s wake you see below. There is so much to see in that one picture: The wake, the rain shower in the background, the changing surface roughness from rougher, darker areas, and smoother, lighter areas, and then the areas in the foreground where we can look into the water (see here for why we can do that in some places and not in others)

Same thing as above, only in a different picture…

And again, this time with a really impressive black cloud. And interference pattern in the waves in the foreground.

And now even ring waves that that seagull made…

And as if I hadn’t had enough wave watching in one day, here is a different spot in the afternoon. See the interference pattern as waves get refracted around the bollard?

And, of course, another strong shower came and made us retreat to the inside. But see the rainbow in the picture below? Those are the kind of things that make me really happy! :-)