Skip to content

Commit

Permalink
Merge branch 'main' into issues/1269
Browse files Browse the repository at this point in the history
  • Loading branch information
svekars authored Nov 9, 2023
2 parents 060dc6a + 66eaf6a commit 1726ae9
Show file tree
Hide file tree
Showing 9 changed files with 462 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pyspelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ matrix:
- open: '\.\.\s+(figure|literalinclude|math|image|grid)::'
close: '\n'
# Exclude roles:
- open: ':(?:(class|py:mod|mod|func)):`'
- open: ':(?:(class|py:mod|mod|func|meth|obj)):`'
content: '[^`]*'
close: '`'
# Exclude reStructuredText hyperlinks
Expand Down Expand Up @@ -70,7 +70,7 @@ matrix:
- open: ':figure:.*'
close: '\n'
# Ignore reStructuredText roles
- open: ':(?:(class|file|func|math|ref|octicon)):`'
- open: ':(?:(class|file|func|math|ref|octicon|meth|obj)):`'
content: '[^`]*'
close: '`'
- open: ':width:'
Expand Down
Binary file added _static/img/rollout_recurrent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions beginner_source/introyt/tensorboardyt_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,14 @@ def forward(self, x):
# Check against the validation set
running_vloss = 0.0

net.train(False) # Don't need to track gradents for validation
# In evaluation mode some model specific operations can be omitted eg. dropout layer
net.train(False) # Switching to evaluation mode, eg. turning off regularisation
for j, vdata in enumerate(validation_loader, 0):
vinputs, vlabels = vdata
voutputs = net(vinputs)
vloss = criterion(voutputs, vlabels)
running_vloss += vloss.item()
net.train(True) # Turn gradients back on for training
net.train(True) # Switching back to training mode, eg. turning on regularisation

avg_loss = running_loss / 1000
avg_vloss = running_vloss / len(validation_loader)
Expand Down
1 change: 1 addition & 0 deletions en-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Colab
Conv
ConvNet
ConvNets
customizable
DCGAN
DCGANs
DDP
Expand Down
9 changes: 7 additions & 2 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,20 @@ What's new in PyTorch tutorials?
:link: intermediate/mario_rl_tutorial.html
:tags: Reinforcement-Learning

.. customcarditem::
:header: Recurrent DQN
:card_description: Use TorchRL to train recurrent policies
:image: _static/img/rollout_recurrent.png
:link: intermediate/dqn_with_rnn_tutorial.html
:tags: Reinforcement-Learning

.. customcarditem::
:header: Code a DDPG Loss
:card_description: Use TorchRL to code a DDPG Loss
:image: _static/img/half_cheetah.gif
:link: advanced/coding_ddpg.html
:tags: Reinforcement-Learning



.. Deploying PyTorch Models in Production
Expand Down
Loading

0 comments on commit 1726ae9

Please sign in to comment.