Git Product home page Git Product logo

rainy's Issues

Revisit Agent classes

Now we have two types of agents

  • OneStepAgent
    • for DQN-like algorithms
    • execute 1-step + stores transition to replay buffer + train agent by sampled transitions
  • NStepParallelAgent
    • for A2C-like algorithms
    • execute N-step in parallel environments + train the policy in an online manner
      These 2 divisions are practical but lack flexibility.
      E.g., we cannot extend OneStep algorithms to batched-parallel style without rewriting the whole process.

So we should re-define agent hierarchies using some important properties, like

  • Online/Offline(or use replay buffer or not)
  • MultiStep/OneStep
  • Not Parallel/Batch Parallel/ Async Parallel

Errors in bootdqn_cartpole.py?

Hi @kngwyu,

When I ran your bootdqn_cartpole.py like this:

python examples\bootdqn_cartpole.py train

I got:

Traceback (most recent call last):
File "examples\bootdqn_cartpole.py", line 21, in
) -> Config:
File "C:\rainy\cli.py", line 227, in decorator
rainy_cli(obj=_CLIContext(f, agent, agent_selector, script_path))
File "C:\Miniconda3\lib\site-packages\click\core.py", line 829, in call
return self.main(*args, **kwargs)
File "C:\Miniconda3\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Miniconda3\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Miniconda3\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Miniconda3\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Miniconda3\lib\site-packages\click\decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\rainy\cli.py", line 52, in train
experiment.train(eval_render=eval_render)
File "C:\rainy\experiment.py", line 97, in train
for res in self.ag.train_episodes(self.config.max_steps):
File "C:\rainy\agents\base.py", line 274, in train_episodes
self.store_transition(state, action, *transition[:-1]) # Do not pass info
TypeError: store_transition() takes 4 positional arguments but 6 were given

Thanks for your help!

BTW:
I can run your dqn_cartpole.py like this:
python examples\dqn_cartpole.py train
with no problems.

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.