Skip to content

Commit

Permalink
Move link to full implementation to top
Browse files Browse the repository at this point in the history
I think it's better to have that at the start for people who want to
open it as a reference while reading the README.
  • Loading branch information
SwamyDev committed Sep 30, 2019
1 parent 731db7c commit 1fff45d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pip install reinforcement
## Example Implementation
This section demonstrates how to implement a REINFORCE agent and benchmark it on the 'CartPole' gym environment.

You can find the full implementation in [examples/reinforce.py](example/reinforce.py). The [example folder](example/) also contains some additional utility classes and functions that are used in the implementation.

[embedmd]:# (example/reinforce.py python /def run_reinforce/ /env.close\(\)/)
```python
def run_reinforce(config):
Expand Down Expand Up @@ -56,8 +58,6 @@ def _run_episode(env, episode, agent, report):

This function performs a run through a single episode of the environment. Observations of the environment are passed to the agent's `next_action` interface function. The resulting estimated actions are passed again to the environment, leading to the next observation and a reward signal. The agent is then trained at the end of the episode because we want to train it on whole trajectories. It also contains a call to `env.render()` to visualize some runs.

You can find the full implementation in [examples/reinforce.py](example/reinforce.py). The [example folder](example/) also contains some additional utility classes and functions that are used in the implementation.

## Running an Example
Running the REINFORCE agent example with default settings:
```bash
Expand Down

0 comments on commit 1fff45d

Please sign in to comment.