Skip to content

Commit 9ceec13

Browse files
committed
Automated tutorials push
1 parent b15ce9f commit 9ceec13

File tree

227 files changed

+27490
-38223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+27490
-38223
lines changed

_downloads/3195443a0ced3cabc0ad643537bdb5cd/introyt1_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "8c435514",
37+
"id": "ad604f57",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "1fb16197",
53+
"id": "bdb8ea62",
5454
"metadata": {},
5555
"source": [
5656
"\n",

_downloads/4355e2cef7d17548f1e25f97a62828c4/template_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{
3232
"cell_type": "code",
3333
"execution_count": null,
34-
"id": "f9d9dd42",
34+
"id": "6c25900f",
3535
"metadata": {},
3636
"outputs": [],
3737
"source": [
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"cell_type": "markdown",
50-
"id": "b1c29b13",
50+
"id": "b7b47ae0",
5151
"metadata": {},
5252
"source": [
5353
"\n",

_downloads/63a0f0fc7b3ffb15d3a5ac8db3d521ee/tensors_deeper_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "a3abe643",
37+
"id": "d1f2da11",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "3ebb3836",
53+
"id": "27800b50",
5454
"metadata": {},
5555
"source": [
5656
"\n",

_downloads/6ea0e49c7d0da2713588ef1a3b64eb35/reinforcement_q_learning.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,24 @@
9292
)
9393

9494

95+
# To ensure reproducibility during training, you can fix the random seeds
96+
# by uncommenting the lines below. This makes the results consistent across
97+
# runs, which is helpful for debugging or comparing different approaches.
98+
#
99+
# That said, allowing randomness can be beneficial in practice, as it lets
100+
# the model explore different training trajectories.
101+
102+
103+
# seed = 42
104+
# random.seed(seed)
105+
# torch.manual_seed(seed)
106+
# env.reset(seed=seed)
107+
# env.action_space.seed(seed)
108+
# env.observation_space.seed(seed)
109+
# if torch.cuda.is_available():
110+
# torch.cuda.manual_seed(seed)
111+
112+
95113
######################################################################
96114
# Replay Memory
97115
# -------------
@@ -253,13 +271,15 @@ def forward(self, x):
253271
# EPS_DECAY controls the rate of exponential decay of epsilon, higher means a slower decay
254272
# TAU is the update rate of the target network
255273
# LR is the learning rate of the ``AdamW`` optimizer
274+
256275
BATCH_SIZE = 128
257276
GAMMA = 0.99
258277
EPS_START = 0.9
259-
EPS_END = 0.05
260-
EPS_DECAY = 1000
278+
EPS_END = 0.01
279+
EPS_DECAY = 2500
261280
TAU = 0.005
262-
LR = 1e-4
281+
LR = 3e-4
282+
263283

264284
# Get number of actions from gym action space
265285
n_actions = env.action_space.n

_downloads/770632dd3941d2a51b831c52ded57aa2/trainingyt.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{
3636
"cell_type": "code",
3737
"execution_count": null,
38-
"id": "49ddae15",
38+
"id": "819011af",
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "markdown",
54-
"id": "55d88584",
54+
"id": "e43a9627",
5555
"metadata": {},
5656
"source": [
5757
"\n",

_downloads/9da0471a9eeb2351a488cd4b44fc6bbf/reinforcement_q_learning.ipynb

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,25 @@
111111
" \"cuda\" if torch.cuda.is_available() else\n",
112112
" \"mps\" if torch.backends.mps.is_available() else\n",
113113
" \"cpu\"\n",
114-
")"
114+
")\n",
115+
"\n",
116+
"\n",
117+
"# To ensure reproducibility during training, you can fix the random seeds\n",
118+
"# by uncommenting the lines below. This makes the results consistent across\n",
119+
"# runs, which is helpful for debugging or comparing different approaches.\n",
120+
"#\n",
121+
"# That said, allowing randomness can be beneficial in practice, as it lets\n",
122+
"# the model explore different training trajectories.\n",
123+
"\n",
124+
"\n",
125+
"# seed = 42\n",
126+
"# random.seed(seed)\n",
127+
"# torch.manual_seed(seed)\n",
128+
"# env.reset(seed=seed)\n",
129+
"# env.action_space.seed(seed)\n",
130+
"# env.observation_space.seed(seed)\n",
131+
"# if torch.cuda.is_available(): \n",
132+
"# torch.cuda.manual_seed(seed)"
115133
]
116134
},
117135
{
@@ -304,13 +322,15 @@
304322
"# EPS_DECAY controls the rate of exponential decay of epsilon, higher means a slower decay\n",
305323
"# TAU is the update rate of the target network\n",
306324
"# LR is the learning rate of the ``AdamW`` optimizer\n",
325+
"\n",
307326
"BATCH_SIZE = 128\n",
308327
"GAMMA = 0.99\n",
309328
"EPS_START = 0.9\n",
310-
"EPS_END = 0.05\n",
311-
"EPS_DECAY = 1000\n",
329+
"EPS_END = 0.01\n",
330+
"EPS_DECAY = 2500\n",
312331
"TAU = 0.005\n",
313-
"LR = 1e-4\n",
332+
"LR = 3e-4\n",
333+
"\n",
314334
"\n",
315335
"# Get number of actions from gym action space\n",
316336
"n_actions = env.action_space.n\n",

_downloads/c28f42852d456daf9af72da6c6909556/captumyt.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"cell_type": "code",
3939
"execution_count": null,
40-
"id": "4d0c1f3c",
40+
"id": "4d1f56b9",
4141
"metadata": {},
4242
"outputs": [],
4343
"source": [
@@ -53,7 +53,7 @@
5353
},
5454
{
5555
"cell_type": "markdown",
56-
"id": "c2d4950b",
56+
"id": "810109c0",
5757
"metadata": {},
5858
"source": [
5959
"\n",

_downloads/e2e556f6b4693c2cef716dd7f40caaf6/tensorboardyt_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{
3636
"cell_type": "code",
3737
"execution_count": null,
38-
"id": "36b705df",
38+
"id": "6a2acd46",
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "markdown",
54-
"id": "00ca459b",
54+
"id": "effddd93",
5555
"metadata": {},
5656
"source": [
5757
"\n",

_downloads/ed9d4f94afb79f7dada6742a06c486a5/autogradyt_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "4a5e0021",
37+
"id": "7518f449",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "5d13281e",
53+
"id": "63efbf93",
5454
"metadata": {},
5555
"source": [
5656
"\n",

_downloads/fe726e041160526cf828806536922cf6/modelsyt_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "460a80a0",
37+
"id": "cd6cce52",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "c45c6395",
53+
"id": "678191f5",
5454
"metadata": {},
5555
"source": [
5656
"\n",

0 commit comments

Comments
 (0)