Skip to content

Commit 4896b3d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent aa81ac5 commit 4896b3d

8 files changed

+211
-211
lines changed

examples/notebooks/Brax_Experiments_with_PGPE.ipynb

+32-32
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "096c868b-ef91-42df-903f-a0a046ccad95",
5+
"id": "0",
66
"metadata": {},
77
"source": [
88
"# Solving a Brax environment using EvoTorch\n",
@@ -27,7 +27,7 @@
2727
{
2828
"cell_type": "code",
2929
"execution_count": null,
30-
"id": "c786f423-220e-4c86-8e06-05edbfd45c42",
30+
"id": "1",
3131
"metadata": {},
3232
"outputs": [],
3333
"source": [
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"cell_type": "markdown",
45-
"id": "8b547977-1478-4b82-95c4-12a79769336d",
45+
"id": "2",
4646
"metadata": {},
4747
"source": [
4848
"We now check if CUDA is available. If it is, we prepare a configuration which will tell `VecGymNE` to use a single GPU both for the population and for the fitness evaluation operations. If CUDA is not available, we will instead turn to actor-based parallelization on the CPU to boost the performance."
@@ -51,7 +51,7 @@
5151
{
5252
"cell_type": "code",
5353
"execution_count": null,
54-
"id": "d45edbf5-b0e9-43a0-869a-5146321ddd4e",
54+
"id": "3",
5555
"metadata": {},
5656
"outputs": [],
5757
"source": [
@@ -90,7 +90,7 @@
9090
},
9191
{
9292
"cell_type": "markdown",
93-
"id": "f1387654-13b4-4367-9d3e-ffda6b3aaf5d",
93+
"id": "4",
9494
"metadata": {},
9595
"source": [
9696
"We now define our policy. The policy can be expressed as a string, or as an instance or as a subclass of `torch.nn.Module`."
@@ -99,7 +99,7 @@
9999
{
100100
"cell_type": "code",
101101
"execution_count": null,
102-
"id": "4d62b5e2-6471-4c86-b028-7997426270f8",
102+
"id": "5",
103103
"metadata": {},
104104
"outputs": [],
105105
"source": [
@@ -162,7 +162,7 @@
162162
},
163163
{
164164
"cell_type": "markdown",
165-
"id": "166e7f59-b727-44b4-9f60-dc7cbec9943b",
165+
"id": "6",
166166
"metadata": {},
167167
"source": [
168168
"Below, we instantiate our `VecGymNE` problem."
@@ -171,7 +171,7 @@
171171
{
172172
"cell_type": "code",
173173
"execution_count": null,
174-
"id": "56b5f554-cdec-40a5-8e21-fa09ea53e047",
174+
"id": "7",
175175
"metadata": {},
176176
"outputs": [],
177177
"source": [
@@ -207,7 +207,7 @@
207207
},
208208
{
209209
"cell_type": "markdown",
210-
"id": "bce02d7c-400c-4c22-9bb8-aa70fa4b1da2",
210+
"id": "8",
211211
"metadata": {},
212212
"source": [
213213
"---\n",
@@ -220,7 +220,7 @@
220220
},
221221
{
222222
"cell_type": "markdown",
223-
"id": "95417793-3835-47b1-b10a-7f36e78fa3ad",
223+
"id": "9",
224224
"metadata": {},
225225
"source": [
226226
"Initialize a PGPE to work on the problem.\n",
@@ -233,7 +233,7 @@
233233
{
234234
"cell_type": "code",
235235
"execution_count": null,
236-
"id": "bce9f851-68aa-4e67-9dbb-2474a5ebd4cf",
236+
"id": "10",
237237
"metadata": {},
238238
"outputs": [],
239239
"source": [
@@ -257,7 +257,7 @@
257257
},
258258
{
259259
"cell_type": "markdown",
260-
"id": "da60f156-6756-41a4-b261-82ee62d7f7cb",
260+
"id": "11",
261261
"metadata": {},
262262
"source": [
263263
"We register two loggers for our PGPE instance.\n",
@@ -269,7 +269,7 @@
269269
{
270270
"cell_type": "code",
271271
"execution_count": null,
272-
"id": "91270ba2-ce78-43e7-bf01-20c94b0529c3",
272+
"id": "12",
273273
"metadata": {},
274274
"outputs": [],
275275
"source": [
@@ -279,7 +279,7 @@
279279
},
280280
{
281281
"cell_type": "markdown",
282-
"id": "7b4d16c1-078c-4d7d-bd6f-e3ff28173667",
282+
"id": "13",
283283
"metadata": {},
284284
"source": [
285285
"We are now ready to start the evolutionary search."
@@ -288,7 +288,7 @@
288288
{
289289
"cell_type": "code",
290290
"execution_count": null,
291-
"id": "0a1a84a0-47ea-4592-bd37-5e96fc8f6e54",
291+
"id": "14",
292292
"metadata": {},
293293
"outputs": [],
294294
"source": [
@@ -298,7 +298,7 @@
298298
{
299299
"cell_type": "code",
300300
"execution_count": null,
301-
"id": "8491f968-4f43-4df6-aac0-a09c756185da",
301+
"id": "15",
302302
"metadata": {},
303303
"outputs": [],
304304
"source": [
@@ -310,7 +310,7 @@
310310
{
311311
"cell_type": "code",
312312
"execution_count": null,
313-
"id": "5731e007-55b3-49ef-9285-9d9137232c9d",
313+
"id": "16",
314314
"metadata": {},
315315
"outputs": [],
316316
"source": [
@@ -319,7 +319,7 @@
319319
},
320320
{
321321
"cell_type": "markdown",
322-
"id": "0efa9df1-c978-4c2a-a528-c98e761caec7",
322+
"id": "17",
323323
"metadata": {},
324324
"source": [
325325
"Now, we receive our trained policy as a torch module."
@@ -328,7 +328,7 @@
328328
{
329329
"cell_type": "code",
330330
"execution_count": null,
331-
"id": "8ea4d211-08c2-4a59-ab84-23988646895e",
331+
"id": "18",
332332
"metadata": {},
333333
"outputs": [],
334334
"source": [
@@ -339,7 +339,7 @@
339339
},
340340
{
341341
"cell_type": "markdown",
342-
"id": "e7c7581d-24ba-4f06-88e2-41bb3274cd37",
342+
"id": "19",
343343
"metadata": {},
344344
"source": [
345345
"---\n",
@@ -352,7 +352,7 @@
352352
{
353353
"cell_type": "code",
354354
"execution_count": null,
355-
"id": "c99f0ea4-7638-4e8a-a0a2-d9f483c8c096",
355+
"id": "20",
356356
"metadata": {},
357357
"outputs": [],
358358
"source": [
@@ -386,7 +386,7 @@
386386
},
387387
{
388388
"cell_type": "markdown",
389-
"id": "19d38fe1-9d6f-40ec-926d-3c4066a4b66a",
389+
"id": "21",
390390
"metadata": {},
391391
"source": [
392392
"Below, we define a utility function named `use_policy(...)`.\n",
@@ -406,7 +406,7 @@
406406
{
407407
"cell_type": "code",
408408
"execution_count": null,
409-
"id": "e8c6554d-4bdb-49b9-8c2e-956bce6ddb8a",
409+
"id": "22",
410410
"metadata": {},
411411
"outputs": [],
412412
"source": [
@@ -430,7 +430,7 @@
430430
},
431431
{
432432
"cell_type": "markdown",
433-
"id": "28c044fe-4639-411c-be78-ac09cbe5e78f",
433+
"id": "23",
434434
"metadata": {},
435435
"source": [
436436
"We now initialize a new instance of our brax environment, and trigger the jit compilation on its `reset` and `step` methods."
@@ -439,7 +439,7 @@
439439
{
440440
"cell_type": "code",
441441
"execution_count": null,
442-
"id": "c1251e82-1d0f-4e43-a6c5-1ec4c0275dab",
442+
"id": "24",
443443
"metadata": {},
444444
"outputs": [],
445445
"source": [
@@ -454,7 +454,7 @@
454454
},
455455
{
456456
"cell_type": "markdown",
457-
"id": "55229cc2-aad5-4c78-b095-010a538adb40",
457+
"id": "25",
458458
"metadata": {},
459459
"source": [
460460
"Below we run our policy and collect the states of the episodes."
@@ -463,7 +463,7 @@
463463
{
464464
"cell_type": "code",
465465
"execution_count": null,
466-
"id": "220ec837-1d1a-401e-a144-5516bdb3e493",
466+
"id": "26",
467467
"metadata": {},
468468
"outputs": [],
469469
"source": [
@@ -489,7 +489,7 @@
489489
},
490490
{
491491
"cell_type": "markdown",
492-
"id": "c9bbe53a-40f5-4bf5-a063-47f1d88032d6",
492+
"id": "27",
493493
"metadata": {},
494494
"source": [
495495
"Length of the episode and the total reward:"
@@ -498,7 +498,7 @@
498498
{
499499
"cell_type": "code",
500500
"execution_count": null,
501-
"id": "80345e9c-0694-413d-81c2-205dfacdfb5a",
501+
"id": "28",
502502
"metadata": {},
503503
"outputs": [],
504504
"source": [
@@ -507,7 +507,7 @@
507507
},
508508
{
509509
"cell_type": "markdown",
510-
"id": "8b6ec424-e6cc-453a-93fd-eb07e44c1bd6",
510+
"id": "29",
511511
"metadata": {},
512512
"source": [
513513
"Visualization of the policy:"
@@ -516,7 +516,7 @@
516516
{
517517
"cell_type": "code",
518518
"execution_count": null,
519-
"id": "7ec60419-1ad0-4f19-bc1e-f2048577ea29",
519+
"id": "30",
520520
"metadata": {},
521521
"outputs": [],
522522
"source": [
@@ -531,7 +531,7 @@
531531
{
532532
"cell_type": "code",
533533
"execution_count": null,
534-
"id": "a07c70f6-2c93-43a1-b4c3-edd3f395302a",
534+
"id": "31",
535535
"metadata": {},
536536
"outputs": [],
537537
"source": [

0 commit comments

Comments
 (0)