aidynamicaction / rcognita Goto Github PK
View Code? Open in Web Editor NEWrcognita is a flexibly configurable framework for agent-enviroment simulation with a menu of predictive and safe reinforcement learning controllers
License: MIT License
rcognita is a flexibly configurable framework for agent-enviroment simulation with a menu of predictive and safe reinforcement learning controllers
License: MIT License
A great deal of code is currently documented in an unconventional fashion. To be more precise, there seems to be a tendency to use headings to describe attributes, parameters and returned values, as opposed using info field lists.
For instance consider the docstring for rcognita.controllers.ctrl_selector
:
Main interface for various controllers.
Parameters
----------
mode : : string
Controller mode as acronym of the respective control method.
Returns
-------
action : : array of shape ``[dim_input, ]``.
Control action.
The conventional way to produce a docstring bearing such information would be:
Main interface for various controllers.
:param str mode: Controller mode as acronym of the respective control method.
:return: Control action
:rtype: array of shape ``[dim_input, ]``
Here are some requirements for implementation of Rcognita framework for tests.
A framework should be easy-to-use
It should be provided with comprehensive and clear instructions on how to create tests using this framework
It should cover all currently implemented presets
It should prevent code duplication
There should be an out-of-the-box possibility to generate a reference data for unit-tests
Fix simulation animation to work in default Python interpreter instead of only ipython
Suggestion (example for one argument):
dt = []
parser.add_argument('--dt', type=float, metavar='dt',
default=0.1,
help='Controller sampling time.' )
__init__ should have a docstring of its own. The "Attributes" section in class dosctrings is reserved for attributes. Violating this convention really messes up the wiki. We should fix that (preferably by next release I think) and from now on proceed to document new classes conventionally.
Code cleaning and refactoring needed for the modifications done throughout Q1, Q2 of 2021, including those done for education.
This concerns:
and so on
We need a call capability like:
python main_3wrobot_NI.py -ctrl_mode JACS -dt 0.01 ...
Required parameters:
Parameter name | Values | Notes |
---|---|---|
ctrl_mode |
string | see description of methods in preset |
dt |
number | controller sampling time |
t1 |
number | final time |
x0 |
numpy vector | initial state, dimension preset-specific! |
Optional parameters, set to default values unless specified otherwise:
Parameter name | Values | Default | Description |
---|---|---|---|
is_log_data |
binary | 0 | |
is_visualization |
binary | 1 | |
is_print_sim_step |
binary | 1 | |
is_est_model |
binary | 0 | if a model of the env. is to be estimated online |
model_est_stage |
number | 1 | seconds to learn model until benchmarking controller kicks in |
model_est_period |
number | 1*dt |
model is updated every model_est_period seconds |
model_order |
integer | 5 | order of state-space estimation model |
prob_noise_pow |
number | 8 | power of probing noise |
uMan |
numpy vector | zeros | manual control action to be fed constant, system-specific! |
Nactor |
integer | 3 | horizon length (in steps) for predictive controllers |
pred_step_size |
number | dt |
|
buffer_size |
integer | 10 | |
rcost_struct |
string | quadratic |
structure of running cost function |
R1 |
numpy matrix | identity matrix | must have proper dimension |
R2 |
numpy matrix | identity matrix | must have proper dimension |
Ncritic |
integer | 4 | critic stack size (number of TDs) |
gamma |
number | 1 | discount factor |
critic_period |
number | dt |
critic is updated every critic_period seconds |
critic_struct |
string | quad-nomix |
structure of critic features |
actor_struct |
string | quad-nomix |
structure of actor features |
This needs to be reflected in the readme, as an example call of an example present. Could probably be translated from this text.
Create a ROS_harnesses.py module to separate a ROS preset and a ROS setting utility
Right now, the full state vector in the closed loop function of the system interface contain components related to the disturbance, even if the latter is switched off. Need case distinction as:
sudo apt-get install -y build-essential gfortran cmake libopenblas-dev
pacman -Sy gcc gcc-fortran cmake base-devel openblas
pip install scikit-build
or
conda install scikit-build
Update:
The documentation needs update according to the actual rst
s
@osinenkop
Is it possible to move it
rcognita/rcognita/controllers.py
Lines 1256 to 1260 in 7d09799
Please use this branch https://github.com/AIDynamicAction/mpldatacursor/tree/rcognita-v0.1
Add command line arguments for main script
The solution here is a class which has the following structure:
class abstract_config:
def __init__(self):
self.name = "some_agent"
def argument_parser(self):
pass
def post_processing(self):
pass
def get_env(self):
pass
It's very intuitive separation of command-line arguments and other arguments together with their post-processing.
Test package in jupyter notebook and fix bugs
There were currently implemented a framework for testing and reference data generation. To make it possible to test preset and improve readability of the code all presets were implemented using pipeline approach that appeared to be a good pattern for implementation of presets. To transfer Rcognita to the new preset implementation pattern, it is necessary to:
Need:
Visualizer: as always (like 3wrobot), but upper left screen: pendulum and its trajectory (dotted line like 3wrobot)
Monte-Carlo scenario:
Policy must be a PDF (probability distro func). Useful policy parametrizations -- see S&B, p. 322 book.
REINFORCE algorithm can also be found there
Add --config flag to allow change default arguments to custom settings
Check everything for correctness and necessity.
Split into different readable folders.
All data on kompaso's ssd.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.