Skip to content

Fixed reinforcement learning to run with any screen size; added diagram #389

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

Merged
merged 2 commits into from
Dec 19, 2018

Conversation

mike9ant
Copy link
Contributor

Fixed reinforcement learning to run with different screen sizes (it looks like the resolution coming in was incorrect, which caused the wrong screen subregion to be accessed and training fo fail).

Also, added some improved comments in the tutorial and a diagram of data-plow to make things more understandable.

Don't merge until it passes tests (we see tutorial updated).

@@ -23,7 +23,10 @@
As the agent observes the current state of the environment and chooses
an action, the environment *transitions* to a new state, and also
returns a reward that indicates the consequences of the action. In this
task, the environment terminates if the pole falls over too far.
task, rewards are +1 for every incremental timestep and the environment
terminates if the pole falls over too far or the crat mover more then 2.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crat mover -> cart moves

policy_net = DQN().to(device)
target_net = DQN().to(device)
# Get screen size so that we can initialize layers correctly based on shape
# returned from AI gym. Typical dimentions at this pont are close to 3x40x90
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dimentions -> dimensions

# which is the result of a clamped and down-scaled buffer in get_screen()
init_screen = get_screen()
_, _, screen_height, screen_width = init_screen.shape
#screen_height = init_screen.shape[2]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code?

@soumith
Copy link
Member

soumith commented Dec 19, 2018

the two failures are because of the mnist deadlock appearing again cc: @yf225

@soumith soumith merged commit 0fa8074 into pytorch:master Dec 19, 2018
rodrigo-techera pushed a commit to Experience-Monks/tutorials that referenced this pull request Nov 29, 2021
Fixed reinforcement learning to run with any screen size; added diagram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants