Prev: W3, Next: W5

# Genetic Algorithm

📗 Genetic algorithm uses a genetic representation of a policy and a fitness function for the reward (usually the value function).
📗 The genetic representation need to work for crossover and mutation.
➩ Crossover between \(\pi_{1}\) and \(\pi_{2}\) combines the policies.
➩ Mutation of \(\pi\) randomly change the policy.
📗 \(N\) policies are initialized randomly and the crossover based on the probabilities \(\dfrac{V^{\pi}}{\displaystyle\sum_{n} V^{\pi_{n}}}\) and mutated randomly.

# Flappy Bird


You can simulate the game using your network here:


Click to restart the game (and clear data):

📗 Network:
➩ Layer 1 weights (3 lines, feature 1 weights, feature 2 weights, biases):

➩ Layer 2 weights (1 line, weights then bias):


📗 Data
➩ Distance to next obstacle: horizontal: , vertical:
➩ Score: current distance: , fitness (after game ends):
➩ Obstacle centers:
➩ Features: horizontal: , vertical:
➩ Actions:
➩ Combined data (row 1 is feature 1, row 2 is feature 2, row 3 is action):

You can play a simulation of the game environment here (or use it to generate sample data):



📗 Data
➩ Click to restart the game (and clear data):
➩ Distance to next obstacle: horizontal: , vertical:
➩ Score: current distance: , fitness (after game ends):
➩ Obstacle centers:
➩ Features: horizontal: , vertical:
➩ Actions:
➩ Combined data (row 1 is feature 1, row 2 is feature 2, row 3 is action):





Last Updated: December 10, 2024 at 3:36 AM