Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Bipedal Walker Evo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philip Maas
Bipedal Walker Evo
Commits
46616c15
Commit
46616c15
authored
3 years ago
by
Philip Maas
Browse files
Options
Downloads
Patches
Plain Diff
Added readme and requirements
parent
fb475df6
No related branches found
No related tags found
1 merge request
!2
Evo neuro
Pipeline
#693
failed
3 years ago
Stage: build
Stage: test
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
README.md
+34
-1
34 additions, 1 deletion
README.md
main.py
+3
-3
3 additions, 3 deletions
main.py
population.py
+0
-3
0 additions, 3 deletions
population.py
requirements.txt
+0
-0
0 additions, 0 deletions
requirements.txt
walker.py
+0
-1
0 additions, 1 deletion
walker.py
with
37 additions
and
8 deletions
README.md
+
34
−
1
View file @
46616c15
# Bipedal Walker Evo
Trying to solve the bipedal walker with an evolution algorithm
\ No newline at end of file
This project tries to solve OpenAI's bipedal walker with an evolutionary strategy.
\
After 1000 episodes, which is about 1h of learning, it will reach ~250 reward.
\
Best score until now: 292/300
## How it works
1.
Generate a randomly weighted neural net
2.
Create a population of neural nets with mutated weights
3.
Let every net finish an episode and reward it accordingly
4.
The better the reward, the higher the chance to pass weights to next gen
## Hyperparameters
| Parameter | Description | Interval |
|-------------------|-------------------------------------------------------------|-----------|
|
`HIDDEN_LAYER`
| Size of hidden layer. | [1;∞[ |
|
`POP_SIZE`
| Size of population. | [0;∞[ |
|
`MUTATION_FACTOR`
| Percentage of weights that will be mutated for each mutant. | [0;1] |
|
`LEARNING_RATE`
| This is the rate of learning. | [0;1] |
|
`GENS`
| Number of generations. | [0;1] |
|
`MAX_STEPS`
| Number of steps that are played in one episode. | [0; 1600] |
## Installation
We use Windows, Anaconda and Python 3.7
\
` conda create -n evo_neuro python=3.7`
\
`conda activate evo_neuro`
\
`conda install swig`
\
`pip install -r requirements.txt`
\
## Sources
Environment: https://github.com/openai/gym/wiki/BipedalWalker-v2
\
OpenAI Website: https://gym.openai.com/envs/BipedalWalker-v2/
\
More on evolution strategies: https://openai.com/blog/evolution-strategies/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.py
+
3
−
3
View file @
46616c15
...
...
@@ -8,12 +8,12 @@ HIDDEN_LAYER = 12
POP_SIZE
=
50
MUTATION_FACTOR
=
0.1
# 0 <= x <= 1
LEARNING_RATE
=
0.03
# 0 <= x <= 1
GENS
=
1
000
MAX_STEPS
=
3
00
# after 1600 steps the Environment gives us a done anyway.
GENS
=
3
000
MAX_STEPS
=
12
00
# after 1600 steps the Environment gives us a done anyway.
VERSION
=
1
TEST_WALKER
=
Tru
e
TEST_WALKER
=
Fals
e
LOAD_BRAIN
=
False
RENDER_BEST
=
False
if
TEST_WALKER
:
...
...
This diff is collapsed.
Click to expand it.
population.py
+
0
−
3
View file @
46616c15
import
numpy
as
np
import
random
import
logging
import
copy
from
walker
import
Walker
import
gym
...
...
This diff is collapsed.
Click to expand it.
requirements.txt
0 → 100644
NaN GiB (NaN%)
View file @
46616c15
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
This diff is collapsed.
Click to expand it.
walker.py
+
0
−
1
View file @
46616c15
import
gym
import
numpy
as
np
import
pickle
import
copy
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment