Skip to content

pbvrl/TuiNEAT

Repository files navigation

"Neuro Evolution of Augmented Topologies" JAX implementation.

Cheetah run demo

Training visualizer TUI

Installation:

Clone the repository and install the requirements.txt.

The TUI server requires protobuf, protoc-gen-go, protoc-gen-go-grpc

Usage:

python -m examples.train_<example>

# Common flags:
#   --hparams KEY=VALUE       NEAT hyperparams 
#   --generations=<int>
#   --visualize-training      Send real-time training data to the TUI.
# Examples:
#   python -m examples.train_gaussian --hparam feedforward=True --hparam perturb_wght_stdev=0.1 
#   python -m examples.train_gaussian --visualize-training --generations=200

Visualization TUI

training_visualizer/generate_grpc.sh
cd training_visualizer
go run .

File Structure:

src/data.py, src/hyperparams.py: Main files defining the data for the algo and the policy, and the initialization.

src/solver.py : High level logic of the neat algorithm. Abides by evojax's ask-tell and best_params api; in this way evojax handles the algo-policy-task loop.

src/algo/ : The different chunks of the neat algorithm.

src/policy.py : The functions used for the forward pass, both for the recurrent and feedforward-only settings.

src/topological_sorting.py : For preparing the forward pass data when using the feedforward only setting.

tasks/: Environments for the individuals to run against.

TUI

training_visualizer/server.go : Go program that renders the visualizations in the terminal using a library called tcell. Abides by training_visualizer/grpc_api/schema.proto.

training_visualizer/sugiyama.go : Exposes a function, used in server.go, that renders networks through the Sugiyama method. Unfinished prototype.

training_visualizer/grpc_api/schema.proto: Defines the data to send. Alludes to src/data.py, src/hyperparams.py.

src/extra_modules/training_visualizer/client.py : Prepares and sends the data to training_visualizer/server.go.

**.pb.go, **pb2.py, **pb2_grpc.py: Autogenerated files.

Acknowledgments:

  • EvoJAX: Orchestrates the rollout loop, and provides utils.

  • tcell: The TUI was made with this library.

Tasks:

Sources of ideas:

License

TuiNEAT source-available license

You may use it commercially if your company does not surpass the monetary thresholds in (Clause C), otherwise it must reach a separate agreement. It also contains a clause on redistribution. Beware this is not an OSI-approved license.

Contributing

See CONTRIBUTING.md, LICENSE.md.

Roadmap

  • Finish recurrent examples
  • Benchmark against top alternatives and showcase results
  • Finish TUI: Sugiyama view
  • Finish TUI: Handle both feedforward and recurrent networks
  • Support jax.shard_map (Replace EvoJAX (archived) with own rollout loop)

Maybe

  • Finish tests
  • Finish multiagent example

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors