< Machine trainer

Machine  trainer

Teach the neural network how to play !

Play the game by yourself :

Play

Or create your Artificial Intelligence

  1. Create your neural network
  2. Configure the genetic algorithm
  3. Train your AI
Create an AI

Or get back to where you were Not yet implemented

Load your AI
Next >

Neural network

The network is composed of 3 layers : 1 input layer, 1 hidden layer and 1 output layer. The hidden layer connects inputs and outputs.

Total players Number of players trained simultaneously. Each player corresponds to a network initialized with different values.

<
>

Inputs What information about the game you give to the neural network (ie. what it can "see").

Self

Self position X
Self position Y
Self speed
Self speed X
Self speed Y
Self acceleration X
Self acceleration Y

Objective

Objective position X
Objective position Y
X-distance to objective
Y-distance to objective
Distance from objective

Enemy Not yet implemented

Enemy position X
Enemy position Y
X-distance to enemy
Y-distance to enemy
Distance from enemy

Environment

Distance from center
X-distance to center
Y-distance to center

Neurons in hidden layer The hidden layer connects inputs and outputs.
More nodes means better results but also slower optimization and more CPU usage.

<
>

Outputs What controls over the game you give to the neural network (ie. what it can "do").

Keyboard

Keyboard input ↑
Keyboard input →
Keyboard input ↓
Keyboard input ←

Mouse

Mouse input X
Mouse input Y

Direct control accInstead of using controls, directly set player acceleration.

Set acceleration X
Set acceleration Y

Direct control speedInstead of using controls, directly set player speed. (Not yet implemented)

Set speed X
Set speed Y

Number of connections : 0Indicator of CPU usage.

< Previous
Next >

Genetic algorithm

For each iteration, a selection will occur. The next batch of players will be composed of the winners of last iteration and new players created by crossing them over. Mutations will also happen for a part of the population.

Fitness score At the end of the iteration, a score is computed, ranking all the players. Less fitting players will be eliminated.

- Distance to last objective (DLO) at the endThe closer the player is to the objective, the higher the score.
Number of objectives completed (NOC) at the end
NOC - DLO at the end
- Distance to center at the end
Minimum distance to center
Mean distance to enemy
Distance to enemy at the end
NOC + Distance to enemy at the end
- DLO + Distance to enemy at the end
NOC - DLO + Distance to enemy at the end

Winners What top percent of the population (winners) will we keep for next batch ?

Keep the best
<
%
>

Cross-over Cross-over consists of splitting 2 neural networks in 2 parts and exchanging those parts to create a new neural net.

Half cross-over the best
<
%
>
Random cross-over the best
<
%
>

MutationsMutating consists of modifying the weights associated to random connections, scaling them by a random factor.

Mutate rate Percent chance of any connection to be modified.
0 -> No mutations
100 -> Every connection is mutated
<
%
>
Mutate factor Scaling of the connection modification.

1 -> very small change
100 -> very large change
<
>
Don't mutate top 0 -> mutate everything
100 -> mutate nothing
<
%
>
< Previous
Next >

Simulation

Options

Graphics

Only best player
Enemies
Effects

Game Over

Game-over on enemy contact
Game-over on out-of-bounds

Player controls

Friction Speed decreases over time and limits max speed.
Inertia Acceleration passed as input is spread over time.

Time

-
Speed : x1
+
-
Iteration duration : 10 sec
+

Score progression

Best
Top 50%
Global
Start !
Dev mode (enable locked options)

Score : 000

Best Score : 000

>