ELOC CYBER

LAB 02 / REINFORCEMENT LEARNING LIVE IN YOUR BROWSER

Mario-style jumps

Try a move. Get a reward. Learn what to try next.

Help a little pixel runner collect coins, jump over trouble, and reach the flag. The network starts with random weights and learns from the game’s rewards. No account or installation needed.

Learning liveFresh brain
It’s playing now. Watch an attempt, or load a practiced brain to compare.

The game

First move
Last reward 0.00New attempt
1Attempt
0Coins collected
0.0Attempt reward
0Flags reached

Inside the neural network

ACTUAL FORWARD PASS
Positive valueNegative valueBrighter = larger activation

The ring marks the chosen move. A gold ring means a random exploratory move. Output scores estimate future rewards; they are not probabilities. Hover or tap a neuron to inspect its value.

Change one setting

Exploration now 60%Weight updates 0Memories 0

Fresh learning can take many attempts. A practiced brain was trained with this same learning algorithm. Loading it gives you a useful comparison; it is not a scripted player.

Is practice helping?

—Average reward · last 10 attempts
0Completed attempts in this run

Light line: each attempt. Dark line: the recent average. Rewards can improve, dip, or stay flat. We measure results rather than promising that every attempt will win.

What can the agent see?

It reads the measurements below, not the game’s screenshot. Those are the input neurons. Position, speed, ground contact, and nearby blocks, gaps, enemies, and coins help it make choices.

Recent moves and rewards

    WHAT MAKES THIS REINFORCEMENT LEARNING?

    The game gives feedback, not the right answer.

    1

    Observe

    The agent reads its surroundings: where it is, what is nearby, and what could help or hurt.

    2

    Choose an action

    The network scores each possible move. Sometimes the agent explores with a random move instead.

    3

    Get a reward

    Coins give +1, reaching the flag gives +5, and getting hurt costs 3. Moving right gives a small reward; moving left takes it away. Each move also has a tiny cost.

    4

    Adjust the weights

    It saves what happened and learns from past moves. Better reward estimates can lead to better choices.

    Try this: Load a practiced brain and watch it reach the flag. Then start fresh, turn the speed up, and compare 20 attempts. Does reducing random moves too soon help or hurt? Then compare learning mode and watch-only mode. Which changes the network’s weights?
    A little more detail: how the learning works

    This is a small deep Q-network: input measurements → 24 hidden neurons → 16 hidden neurons → one reward estimate per move. Hidden neurons use tanh; their signed activations are the values shown live.

    Training samples past moves from a memory buffer. The target is the reward received, plus a discounted estimate of later rewards when the attempt continues. A second, slowly updated network helps stabilize those targets. This implementation uses Double DQN action selection, Huber loss, and Adam weight updates.

    At higher speeds, several moves happen between screen frames. The game and network display the latest decision. Connection brightness reflects the signal through that connection. Hidden neurons have no hand-assigned meaning such as “fear” or “jump.”

    This is an original miniature platformer inspired by Mario, with its own art and physics. It is a small course for exploring reinforcement learning. Learning and rendering happen on your device. Downloaded brains contain weights and settings, not an account or a game recording.

    Further reading: PyTorch’s deep Q-learning tutorial.