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

Update README.md #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ We also provide some environments in which to test NEAT and Adaptive HyperNEAT,

## Examples
The following snippet turns a NEAT-Python genome into a recurrent PyTorch network:
```
```python
from pytorch_neat.recurrent_net import RecurrentNet

net = RecurrentNet.create(genome, config, bs)
outputs = net.activate(some_array)
```

You can also turn a NEAT-Python genome into a CPPN:
```
```python
from pytorch_neat.cppn import create_cppn

cppn_nodes = create_cppn(genome, config)
```

A CPPN is represented as a graph structure. For easy evaluation, a CPPN's input and output nodes may be named:
```
```python
from pytorch_neat.cppn import create_cppn

[delta_w_node] = create_cppn(
Expand All @@ -42,7 +42,7 @@ delta_w = delta_w_node(x_in=some_array, y_in=other_array, ...)
```

We also provide some infrastructure for running networks in Gym environments:
```
```python
from pytorch_neat.multi_env_eval import MultiEnvEvaluator
from pytorch_neat.recurrent_net import RecurrentNet

Expand All @@ -66,12 +66,12 @@ fitness = evaluator.eval_genome(genome)
This allows multiple environments to run in parallel for efficiency.

A simple example using NEAT to solve the Cartpole can be run like this:
```
```bash
python3 -m examples.simple.main
```

And a simple example using Adaptive HyperNEAT to partially solve a T-maze can be run like this:
```
```bash
python3 -m examples.adaptive.main
```

Expand Down