Coder Social home page Coder Social logo

neat-gym's People

Contributors

simondlevy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

neat-gym's Issues

Issue with discrete action spaces

Hi again Simon!

I am trying to use neat-gym with some of the Gym toy text examples that are based on discrete action spaces, but I'm having some issues. From my limited understanding of neat-gym it inherits the observation and action space from the registered Gym environment, but I am getting the following errors whenever I attempt to use neat-gym with any of the discrete valued Gym environments:

$pablo python3 neat-evolve.py --eshyper config/frozenlake

 ****** Running generation 0 ****** 

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (4.0.0) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 438, in eval_genome
    return config.eval_net_mean(net, genome)
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 182, in eval_net_mean
    else self.eval_net_mean_reward(net, genome))
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 191, in eval_net_mean_reward
    reward, steps = eval_net(net,
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat_gym/__init__.py", line 123, in eval_net
    action = net.activate(state)
  File "/home/pablo/.local/lib/python3.8/site-packages/neat/nn/recurrent.py", line 27, in activate
    if len(self.input_nodes) != len(inputs):
TypeError: object of type 'int' has no len()
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 766, in <module>
    main()
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 759, in main
    winner = pop.run(pe.evaluate, config.ngen, args.maxtime)
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 471, in run
    fitness_function(list(self.population.items()), self.config)
  File "/home/pablo/.local/lib/python3.8/site-packages/neat/parallel.py", line 30, in evaluate
    genome.fitness = job.get(timeout=self.timeout)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
TypeError: object of type 'int' has no len()
$pablo python3 neat-evolve.py config/frozenlake

Traceback (most recent call last):
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 766, in <module>
    main()
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 736, in main
    config = _GymNeatConfig(args)
  File "/home/pablo/Documents/development/frozenlake/neat-gym/neat-evolve.py", line 109, in __init__
    num_inputs = env.observation_space.shape[0]
IndexError: tuple index out of range

I've tried a couple of the other envs that utilize spaces.Discrete, all with the same type of error. Any ideas?

Cannot import Augmented Genome

I installed neat-gym acccording to the specifications in the ReadMe.

In neat-gym/neat_gym/novelty/tests/, the xor_evolve.py throws an error because AugmentedGenome and the NeatConfig modules cannot be imported.

Question about dynamic action space and ideal architecture

Hi Simon, thanks for releasing this project!

I am interested in implementing NEAT for function approximation, by sampling data points from two "competing" IoT sensors and then using a simple scoring mechanism to determine which sensor outputs the most correct data points. Problem is, the sensors can output two or three values depending on when they are sampled. Dataset looks like this:

[40, 9] [8, 4]
[42, 1, 3] [9, 22]
[8, 5, 7] [2, 9, 80]
[30, 20] [5, 90]
[1, 20, 90] [90, 7]
[70, 5, 90] [90, 9, 20]
[5, 8, 4] [1, 20, 5]

So should I be zero padding everything so that each sample is exactly three elements, or is it possible to use neat-gym in conjunction with a dynamic Gym observation space?

Would ES-HyperNEAT be the best option for this? Any pointers on implementing neat-gym with strictly integer-valued data would be greatly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.