How to render performance of agent visually
- Dominant language
- Jupyter Notebook
- Stars
- 10.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice to show how the agent is performing inside the game, but in the meantime here's some imperfect but functional code.
Note: This dramatically slows the throughput of the model. Only render after the model has finished training. May require additional dependencies (like matplotlib) if not already present.
Inside dopamine/atari/run_experiment.py:
```
def _run_one_step(self, action):
"""Executes a single step in the environment.
Args:
action: int, the action to perform in the environment.
Returns:
The observation, reward, and is_terminal values returned from the
environment.
"""
self._environment.render(mode='human') #Shows game in progress. Note: Slows down training tremendously.
time.sleep(1/60)
observation, reward, is_terminal, _ = self._environment.step(action)
return observation, reward, is_terminal
```
Contributor guide
Assessment
This issue has not been assessed yet.