Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Update RL examples for recent gym 0.25.2 version #1212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions reinforcement_learning/actor_critic.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def main():
for i_episode in count(1):

# reset environment and episode reward
state, _ = env.reset()
state = env.reset()
ep_reward = 0

# for each episode, only run 9999 steps so that we don't
Expand All @@ -152,7 +152,7 @@ def main():
action = select_action(state)

# take the action
state, reward, done, _, _ = env.step(action)
state, reward, done, _ = env.step(action)

if args.render:
env.render()
Expand Down
4 changes: 2 additions & 2 deletions reinforcement_learning/reinforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def finish_episode():
def main():
running_reward = 10
for i_episode in count(1):
state, _ = env.reset()
state = env.reset()
ep_reward = 0
for t in range(1, 10000): # Don't infinite loop while learning
action = select_action(state)
state, reward, done, _, _ = env.step(action)
state, reward, done, _ = env.step(action)
if args.render:
env.render()
policy.rewards.append(reward)
Expand Down