Skip to content

Commit

Permalink
Merge branch 'main' into jingxu10/2629
Browse files Browse the repository at this point in the history
  • Loading branch information
svekars authored Nov 8, 2023
2 parents a5eee63 + ab4e99a commit 1f159ad
Show file tree
Hide file tree
Showing 7 changed files with 455 additions and 7 deletions.
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 1f159ad

Please sign in to comment.