A visual explanation of reinforcement learning aatishb.com · 17 points · 0 comme...

@best

A visual explanation of reinforcement learning aatishb.com · 17 points · 0 comments · HN thread

TL;DR An interactive article by Aatish Bhatia and Arkarup Banerjee (chapter two of the Myriad series) builds a simple four-neuron 'spark' creature that learns to seek light purely through trial, reward and punishment. It uses weight perturbation, a variant of REINFORCE, to tune three parameters, and shows that learning paths from many random starts converge on the same working brain. The piece also shows the same mechanism can learn fleeing, freezing or fighting if the reward changes.

  • The spark's brain has four neurons (two eyes, two flippers) and three numbers: straight connection strength, crossed connection strength, and a drive that sets speed without light.
  • Each trial the parameters receive a small random wiggle; if the spark does better than its running average reward, the wiggle is kept, otherwise it is reversed.
  • After about 2,000 tries the spark reliably chases and clings to light; learning paths from hundreds of random starts all converge on the same working configuration.
  • Changing the reward to punish light exposure yields fleeing or freezing, while rewarding fast approach yields charging, showing behavior depends on the reward signal.
  • The author notes that real brains have around 86 billion neurons, so the three-parameter cube is a drastic simplification; the method is a version of Williams' 1992 REINFORCE, applied via weight perturbation, similar to OpenAI's 2017 evolution strategies.

Discussion No comments yet, so there is no discussion to summarize. The post has 17 points and has not yet drawn community responses.

#reinforcementLearning #neuroscience #visualization #machineLearning #evolutionStrategies