Skip to content

Commit ddc29d6

Browse files
MorvanZhouMorvan Zhou
authored andcommitted
update
1 parent 83eb6b2 commit ddc29d6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ All methods mentioned below have their video and text tutorial in Chinese. Visit
6262
<img class="course-image" src="/demo/nes.gif" >
6363
</a>
6464

65+
### [ES with Neural Net](https://github.com/MorvanZhou/Evolutionary-Algorithm/blob/master/tutorial-contents/Using%20Neural%20Nets/Evolution%20Strategy%20with%20Neural%20Nets.py)
66+
67+
<a href="https://github.com/MorvanZhou/Evolutionary-Algorithm/blob/master/tutorial-contents/Using%20Neural%20Nets/Evolution%20Strategy%20with%20Neural%20Nets.py">
68+
<img class="course-image" src="/demo/es_rl.gif" >
69+
</a>
6570

6671
# Donation
6772

demo/es_rl.gif

81.7 KB
Loading

tutorial-contents/Using Neural Nets/Evolution Strategy with Neural Nets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import gym
1212
import multiprocessing as mp
1313
import time
14-
# np.random.seed(0)
1514

1615
N_KID = 10 # half of the training population
1716
N_GENERATION = 5000 # training step
@@ -25,7 +24,7 @@
2524
n_feature=2, n_action=3, continuous_a=[False], ep_max_step=200, eval_threshold=-120),
2625
dict(game="Pendulum-v0",
2726
n_feature=3, n_action=1, continuous_a=[True, 2.], ep_max_step=200, eval_threshold=-180)
28-
][1] # choose your game
27+
][2] # choose your game
2928

3029

3130
def sign(k_id): return -1. if k_id % 2 == 0 else 1. # mirrored sampling
@@ -135,7 +134,7 @@ def train(net_shapes, net_params, optimizer, utility, pool):
135134
'Gen: ', g,
136135
'| Net_R: %.1f' % mar,
137136
'| Kid_avg_R: %.1f' % kid_rewards.mean(),
138-
'| Step_T: %.2f' % (time.time() - t0),)
137+
'| Gen_T: %.2f' % (time.time() - t0),)
139138
if mar >= CONFIG['eval_threshold']: break
140139

141140
# test

0 commit comments

Comments
 (0)