Skip to content

Commit aaf012e

Browse files
committed
Update the hyperparameters for the brax example
1 parent a9d434a commit aaf012e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

examples/notebooks/Brax_Experiments_with_PGPE.ipynb

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# Solving a Brax environment using EvoTorch\n",
99
"\n",
10-
"This notebook demonstrates how the Brax environment named `humanoid` can be solved using EvoTorch.\n",
10+
"This notebook demonstrates how the Brax environment named `humanoid` can be solved using EvoTorch. The hyperparameters here are tuned for brax version 0.10.5.\n",
1111
"\n",
1212
"EvoTorch provides `VecGymNE`, a neuroevolution problem type that focuses on solving vectorized environments. If GPU is available, `VecGymNE` can utilize it to boost performance. In this notebook, we use `VecGymNE` to solve the `humanoid` task.\n",
1313
"\n",
@@ -170,11 +170,11 @@
170170
"outputs": [],
171171
"source": [
172172
"# --- A simple linear policy ---\n",
173-
"policy = \"Linear(obs_length, act_length)\"\n",
173+
"# policy = \"Linear(obs_length, act_length)\"\n",
174174
"\n",
175175
"\n",
176176
"# --- A feed-forward network ---\n",
177-
"# policy = \"Linear(obs_length, 64) >> Tanh() >> Linear(64, act_length)\"\n",
177+
"policy = \"Linear(obs_length, 64) >> Tanh() >> Linear(64, act_length)\"\n",
178178
"\n",
179179
"\n",
180180
"# --- A feed-forward network with layer normalization ---\n",
@@ -308,17 +308,18 @@
308308
"outputs": [],
309309
"source": [
310310
"RADIUS = 2.25\n",
311-
"MAX_SPEED = RADIUS / 6\n",
312-
"CENTER_LR = MAX_SPEED / 2\n",
311+
"MAX_SPEED = RADIUS / 15\n",
312+
"CENTER_LR = MAX_SPEED * 0.75\n",
313313
"\n",
314314
"POPSIZE = 4000\n",
315-
"NUM_GENERATIONS = 140\n",
315+
"NUM_GENERATIONS = 1000\n",
316316
"SAVE_INTERVAL = 20\n",
317317
"\n",
318318
"# Instantiate a PGPE using the hyperparameters prepared above\n",
319319
"searcher = PGPE(\n",
320320
" problem,\n",
321321
" popsize=POPSIZE,\n",
322+
" num_interactions=(POPSIZE * 1000 * 0.75),\n",
322323
" radius_init=RADIUS,\n",
323324
" center_learning_rate=CENTER_LR,\n",
324325
" optimizer=\"clipup\",\n",

0 commit comments

Comments
 (0)