Skip to content

Commit dea1a85

Browse files
committed
update some notes
1 parent a7c7683 commit dea1a85

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

docs/docs.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
# Documentation
22

3-
When choosing inputs for neural networks like this, it is better to select inputs that are independent of each other.
3+
- When selecting inputs for neural networks like this, it is better to choose inputs that are independent of each other.
4+
- Normalized inputs should have a one-to-one mapping (a function). If this is not followed, the network will not perform well.
5+
- Inputs are crucial; they should be precise, accurate, and have a clear intent. For example, in this project, when the target pipe gap point changes immediately, even if the bird is not fully outside the current pipe gap, the birds cannot perform well. However, this issue was immediately resolved by moving the target pipe gap point slightly to the left so that it changes only after the bird has safely passed over the current pipe gap.
6+
- The network will also struggle if the problem is too difficult. Ensure that the environment is playable before implementing and integrating the network into it.
7+
- Genetic algorithms perform well with larger populations.
8+
- For genetic algorithms, the larger the neural network is, the longer it takes to optimize it.
49

510
# Genetic Algorithm
611

712
## Requirements
813

9-
1. Fitness function - calculates the measure of how well the bird is performing in the environment.
10-
- How long the bird survived.
11-
- How close the bird was to the gap when it died.
14+
1. Fitness function - calculates how well the bird is performing in the environment.
15+
- How long the bird survives.
16+
- How close the bird is to the gap when it dies.
1217

13-
2. `MUTATION_CUT_OFF` - A percentage that indicates how many of the highest fitness birds you want to keep when all the birds have died.
18+
2. `MUTATION_CUT_OFF` - A percentage that indicates how many of the highest fitness birds to keep when all the birds have died.
1419

1520
3. `MUTATION_BAD_TO_KEEP` - A percentage that indicates how many of the **MUTATED BAD BIRDS** you want to keep.
1621

1722
## Steps
1823

19-
1. Generate a population of birds with random weights initialized in their neural network.
24+
1. Generate a population of birds with randomly initialized weights in their neural network.
2025

2126
2. Let the birds run in the environment.
2227

23-
3. When all the birds die, sort them from the highest fitness to the lowest fitness.
28+
3. When all the birds have died, sort them from the highest fitness to the lowest fitness.
2429

25-
4. Isolate the birds with the highest fitness (**GOOD BIRDS**) from the low fitness birds (**BAD BIRDS**).
30+
4. Isolate the birds with the highest fitness (**GOOD BIRDS**) from the birds with low fitness (**BAD BIRDS**).
2631

27-
5. Mutate some of the weights of the **BAD BIRDS** slightly, we will call then now **MUTATED BAD BIRDS**.
32+
5. Slightly mutate some of the weights of the **BAD BIRDS**; we will now call them **MUTATED BAD BIRDS**.
2833

2934
6. Choose a `MUTATION_BAD_TO_KEEP` percentage of random birds to keep from the **MUTATED BAD BIRDS**.
3035

31-
7. Splice/join the **GOOD BIRDS** and the **MUTATED BAD BIRDS** back into the bird population collection.
36+
7. Combine the **GOOD BIRDS** and the **MUTATED BAD BIRDS** back into the bird population.
3237

33-
8. Breed from the **GOOD BIRDS** to fill up the missing number of birds in the resulting population. The way breeding works in this context is by mixing up random weights of two different **GOOD BIRDS**.
38+
8. Breed from the **GOOD BIRDS** to fill up the remaining slots in the population. Breeding, in this context, involves mixing the weights of two different **GOOD BIRDS**.

0 commit comments

Comments
 (0)