Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
gym
  • Loading branch information
Borda committed Mar 24, 2023
commit 5465056a64c02db76b21c7cfdd6f8e369d41eed3
2 changes: 1 addition & 1 deletion lightning_examples/reinforce-learning-DQN/.meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: |
2. Handle unsupervised learning by using an IterableDataset where the dataset itself is constantly updated during training
3. Each training step carries has the agent taking an action in the environment and storing the experience in the IterableDataset
requirements:
- gym
- gym <0.24
- pygame
- pandas
- seaborn
Expand Down
4 changes: 4 additions & 0 deletions lightning_examples/reinforce-learning-DQN/dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def play_step(
action = self.get_action(net, epsilon, device)

# do step in the environment
# So, in the deprecated version of gym, the env.step() has 4 values unpacked which is
# obs, reward, done, info = env.step(action)
# In the latest version of gym, the step() function returns back an additional variable which is truncated.
# obs, reward, terminated, truncated, info = env.step(action)
new_state, reward, done, _ = self.env.step(action)

exp = Experience(self.state, action, reward, done, new_state)
Expand Down