Uncle Josh Scrapes His Knuckles on ML, Pt. 5

When last I left this project I had a runner going in circles, which is not what I want. It seemed that no matter how random the synapses or weights, the final result of the thinker’s thinking was always a number pretty damn close to a number it already produced. I dusted off a little more wxPython to create an app with some sliders and text boxes so I could monitor the results of the calculation.

This means I had to first change the Thinker class object to store the results of each iteration through the thought process, which is as easy as giving the class a list called thoughts, clearing it with every input, and filling it back up again.

The ThinkerTinkerer window, as I’m calling it, uses sliders to mimic the valid inputs I would get from my sample maze and shows the results of each step of the calculation.

I managed to get some variation in the final calculation when moving the inputs. I tried several variations of the code. The basic code was:

def _think(i, s, w):
    calc = np.matmul(s, i) + w
    res = squish(calc)
    return res

np is of course NumPy and Squish is the simple sigmoid function. I realized that only the end product was changed from the output range of 0 to 1 to -1 to 1, and so I made that same transformation during each step of the calculation. I ended up with this guy:

The best it’s gonna get

Most of the randomly generated runners switched from circles to oval or even kidney shaped patterns, but one of them managed to get around the maze in tight circles. It didn’t hit the wall but it came damn close.

I have to step back and ask myself if this is worth continuing, and I don’t think it is. I really wanted to understand the basics and I think I got that far. The fact that I can’t get the runners to do much more than spiral tells me that I don’t really understand the problem. Somehow I should be able to weigh the inputs in some method that provides something less stupid.

But maybe I’ve finished with this project, and I can go back to my other hobbies of losing sensation in my fingers by playing guitar and collecting rejection notices.