Saravanan666/pypi-org huggingface dataset:
Package: rlpy3
RLPy3Why Fork?This is my fork of RLPy.RLPyis a great reinforcement learning library with some good features
like custom representations and value function viewers.
However, it is no longer maintained and the PyPI version of RLPy is not
compatible with the latest numpy C-API, which causes runtime errors.So I decided to fork the repository and provide a maintained version of
RLPy only for Python>=3.6, named RLPy3.
You can download wheels of RLPy3 fromPyPI.In addition, I pushed lots of refactorings, bug fixes, new environments
such asFixedRewardGridWorld, and new algorithms such asPSRL.
I also removed some modules (like parallel-job utilities) to keep this library
maintainable by sufficiently low efforts.To see what was changed, see the newCHANGELOG.InstallThe latest version is 2.0.0b1, which you can install by:pip3 install rlpy3 -U --preScreenshotsAn agent that exploresGridWorld.Value function of the agent.Original README: RLPy - Reinforment Learning FrameworkRLPy is a framework to conduct sequential decision making experiments. The
current focus of this project lies on value-function-based reinforcement
learning. The project is distributed under the 3-Clause BSD License.Important LinksOfficial source code repository:http://github.com/rlpy/rlpyBitbucket mirror:http://bitbucket.org/rlpy/rlpyDocumentation:http://rlpy.readthedocs.orgIssue tracker:https://github.com/rlpy/rlpy/issuesInstallInstallation instructions can be found athttp://rlpy.readthedocs.org/en/latest/install.html
Package: rl-renderPM
rl_renderPMis a package containing the ReportLab accelerator module_renderPMwhich can be used to speedup thereportlab.graphics.renderPMfunctions.The python bitmap render modulereportlab.graphics.renderPMcan either userlPyCairo,pycairoandfreetype-pyorrl_renderPM+ built infreetypelibraries.The choice is made by overriding thereportlab.rl_settingsmodule value_renderPMBackendusing one of the settings filesreportlab/local_reportlab_settings.py,reportlab_settings.pyor~/.reportlab_settings, which are searched for in that order.The default value ofrenderPMBackendis'rlPyCairo', but it can be set to'_renderPM'to use this extension
which is based on an older librarylibart_lgpl.
Package: rl-replicas
Reinforcement Learning ReplicationsReinforcement Learning Replications is a set of Pytorch implementations of reinforcement learning algorithms.FeaturesImplement AlgorithmsVanilla Policy Gradient (VPG)Trust Region Policy Optimization (TRPO)Proximal Policy Optimization (PPO)Deep Deterministic Policy Gradient (DDPG)Twin Delayed DDPG (TD3)Use Python standard logging librarySupport TensorBoardBenchmarksYou can check the benchmark resulthere.This benchmark is conducted based onthe Benchmarks for Spinning Up Implementations.All experiments were run for 3 random seeds each. All the details such as tensorboard and experiment logs, training scripts and trained models are stored in thebenchmarksfolder.Example CodeHere is the code of training PPO on CartPole-v1 environment. You can run withthis Google Colab notebook.importgymimporttorchimporttorch.nnasnnfromrl_replicas.algorithmsimportPPOfromrl_replicas.networksimportMLPfromrl_replicas.policiesimportCategoricalPolicyfromrl_replicas.samplersimportBatchSamplerfromrl_replicas.value_functionimportValueFunctionenv_name="CartPole-v1"output_dir="/content/ppo"num_epochs=80seed=0network_hidden_sizes=[64,64]policy_learning_rate=3e-4value_function_learning_rate=1e-3env=gym.make(env_name)env.action_space.seed(seed)observation_size:int=env.observation_space.shape[0]action_size:int=env.action_space.npolicy_network:nn.Module=MLP(sizes=[observation_size]+network_hidden_sizes+[action_size])value_function_network:nn.Module=MLP(sizes=[observation_size]+network_hidden_sizes+[1])model:PPO=PPO(CategoricalPolicy(network=policy_network,optimizer=torch.optim.Adam(policy_network.parameters(),lr=3e-4),),ValueFunction(network=value_function_network,optimizer=torch.optim.Adam(value_function_network.parameters(),lr=1e-3),),env,BatchSampler(env,seed),)model.learn(num_epochs=num_epochs,output_dir=output_dir)ContributingAll contributions are welcome.Release FlowCreate a release branch.A pull request from the release branch to themainbranch has the following:Change logs in the body.Thereleaselabel.Commit that bumps up the version inVERSION.Once the pull request is ready, merge the pull request. The CI will upload the package and create the release.
Package: rlretry
TODODo the 429 avoidance decorator.  learn the best query interval.  use this before @rlretry.  Or maybe use it after rlretry, but just optimize for how long it takes queries to return in general?  yes.  and as an implementation, try setting the query period to the average duration taken for rlretry to return a succesful response (ie. including retries).  But weight this average towards recent resultsAction.ABRT  Action.RETRY0  Action.RETRY_OVER_2  Action.RETRY_OVER_4  Action.RETRY_OVER_16ClusteredFailure     -1.000002      -1.000018            21.121019            23.934760             -1.630083
RepeatableFailure    -1.000004      -1.000031            -6.006729            -3.505744             -1.631265
RandomFailure        -1.000003      28.042277            17.699553            23.064918             24.598541
TooBusyFailure       -1.000002      -1.000031            20.788450            17.161290             24.380614
Action.ABRT  Action.RETRY0  Action.RETRY_OVER_2  Action.RETRY_OVER_4  Action.RETRY_OVER_16
ClusteredFailure             7              9                   25                  271                     8
RepeatableFailure         3119             67                   62                   61                    67
RandomFailure               34           1632                   35                   36                    27
TooBusyFailure               9             10                  141                    4                   175
Package: rlrisk
A reinforcement learning environment based off the board game Risk. Designed with reinforcement learning in mind, this project aims to streamline research for economy-based games.Getting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.Dependenciesnumpy <= 1.14pygame <= 1.9User installationThe easiest way to install this package is through PyPipip install rlriskOtherwise you can manually install this package by cloning
the repository to your local computergit clone https://github.com/civrev/RLRiskThen navigate to that directory and run setup.pypython setup.py installWorking with RLRiskRLRisk was a project concieved to streamline research by coding an environment already friendly to reinforcement learning techniques. As such working with RLRisk is extremely easy.The EnvironmentThe environment is the standard Wolrd Domination game rules for Risk by Hasbro. You can find these rules here:https://www.hasbro.com/common/instruct/risk.pdfThe environment is located in the file risk.py and is implemented using the class Risk(). The class is flexible enough to be initiallized with extremely custom rules, but for the most common game of Risk you can create a Risk object using only a list of playersfrom rlrisk.agents import *
from rlrisk.environment import *

players = [BaseAgent(), AggressiveAgent()]
env = Risk(players)
results = env.play()AgentsRLRisk comes with 3 agents, the BaseAgent, Human, and AggressiveAgent classes. All new agents must be subclasses of the BaseAgent class, but looking at the BaseAgent will show you that the framework of agents for RLRisk is very straight forward. It takes in the information it need to make a decision, and then it outputs a decision.Final RemarksThis is my Senoir Project for my B.S. in Computer Science at the University of North Georgia
(Graduating May, 2018)
Package: rl_rocket_sim
rocket_sim_6DOFThis is a Python Gym environment to simulate  a 6 degrees of freedom rocket.Featuresfull 6DOF rocket landing environmentrealistic dynamics equation modeled on a rigid body assumptioninteractive 3D visualization through PyVistaactuators available:thrusterfinsWandb logging wrapperContinuous action spaceThe environment employes a continuous action space, with the engine allowed to throttle betweenmaxThrustandminThrust. The thrust was normalized to lie in the range[-1, +1]as best practice for convergence of the algorithms suggest. The engine is gimbaled by two angles $\delta_y$ and $\delta_z$ around two hinge points, respectively moving the engine around the z and y axis.Aerodynamic fins controlResearch question:Is there a reduction in fuel consumption when the thruster is aided by fins? Quantify it.Actuator descriptionPitch plane (x-z) corresponding toi={1,2}:Diagram of the anglesPosition vector of the finiin body coordinates:$$
\vec{x}^{B,i} =
\begin{bmatrix}
x_{fin}^i \ \pm r_{base} \ 0
\end{bmatrix}
$$Yaw plane (x-y) corresponding toi={3,4}:Diagram of the anglesPosition vector of the finiin body coordinates:
$$\vec{x}^{B,i} = \begin{bmatrix}x_{fin}^i \ 0 \ \pm r_{base}\end{bmatrix}$$Actuator control definition (x-y)To compute the force generated by the finiin body axis we have to:Neglecting wind, we can compute the air velocity of the center of mass of the vehicle as:$$ \vec{v}^B_{air} = R_{I \rightarrow B}\vec{v}^I$$Compute the velocity vector at each fin locationi(denoted by itsposition vectorin body coordinates $\vec{x}^{B,i}$), taking into account the rotation of the rocket:$$
\vec{v}^{B,i}{air} = \vec{v}^B{air} + \vec{\omega}^B \times \left[ \vec{x}^{B,i} - \vec{x}^{B,CG}\right]
$$Compute theaerodynamic anglesat the location of each fini:x-zplane aerodynamic angle:$$\alpha^i = \arctan 2 \left[ \frac{v_z^{B,i}}{v_x^{B,i}} \right]$$x-yplane aerodynamic angle:$$
\beta^i = \arcsin \left[ \frac{v_y^{B,i}}{||\vec{v}^{B,i}||} \right]
$$Inputtheangle of deflection from the longitudinal axisof the fin $\beta_{fin,i}$ (i.e. thecontrol input).Compute theangle of attack$AoA$ of each fini:Yaw plane (x-y):
$$AoA_i = -\beta_{fin,i} - \beta^i$$Pitch plane (x-z):
$$AoA_i = \beta_{fin,i} - \alpha^i$$Compute theaerodynamic pressure$$q=\frac{1}{2}\rho(x)||\vec{\vec{v}^{B,i}_{air}}||$$Compute thenormal force coefficient$C_f$:$$ C_f(AoA_i)=\bar{C_f} \sin{AoA_i} $$Compute the aerodynamic force at each fini:Yaw plane (x-y):$$ \vec{F}^B_{fin,i} = qS_{fin}C_f\left(AoA_i\right)
\begin{bmatrix}
\sin{\beta_{fin,i}} & \cos{\beta_{fin,i}} & 0
\end{bmatrix}^T$$Pitch plane (x-z):$$ \vec{F}^B_{fin,i} = qS_{fin}C_f\left(AoA_i\right)
\begin{bmatrix}
-\sin{\beta_{fin,i}} & 0 & \cos{\beta_{fin,i}}
\end{bmatrix}^T$$Compute the aerodynamictorquefor each fini:$$ M^i = \left[ \vec{x}^{B,i} - \vec{x}^{B,CG}\right] \times \vec{F}^B_{fin,i} $$
Package: rlrunner
An easy to use and expand framework for Reinforcement Learning experimentation and run simulation.Full read.me can be found herehttps://github.com/PriestTheBeast/RLRunner. Excerpt of it is below.I had some difficulty naming this project and ended up choosing RL runner, but some other options would be RL Agent runner, Agent comparator, RL Running System, Agent Running system, etc…In the past I’ve wanted, both academically and for fun experimentations, to compare different RL agents with different parameters and different environments, but didn’t find anything except gym, which only helped with environments. So I made my own system for performing runs with different agents and environments, adding other features along as I found necessary and useful. In the end it was a mess of code, but code that could be useful for other people that might need what I also needed.So, I wrote this RL running framework from the ground up with this in mind: as much freedom as possible for experimenting and doing what people want while providing a good foundation for building upon it.I made this to be as whatever you might need as possible.You can install as a library and quickly have a system for comparing some agents and experiment in RL,
or even take the package from here, slam it in your project and redesign anything you want from it.Sharing your work should also be simpler when both people use the same underlying system, no matter if it’s an original agent, env or anything else.In case you are a teacher you could even take this runner, or make one from it custom to your needs, and give your students a good foundation to build upon and learn. You can even directly compare their agents under the same rules and make fun competitions.I hope this can be useful to people :)
Package: rlsa
RLSAC implementation ofRLSAfor use in python.UsageRequirementspython version >= 3.8InstallInstall with:pip install rlsaUsageThe main function isrlsa.It takes as input a black and white image (as a uint8 numpy array), and the hvs, vsv and ahvs values.
The function returns a new black and white image, leaving the original one intact.You can also import therlsa_horizontalandrlsa_verticalfunctions to apply only one of the RLSA components.Usage exampleA full example would be:import cv2
from rlsa import rlsa

img = cv2.imread("assets/rlsa_test_image.jpg", cv2.IMREAD_GRAYSCALE)
_, binary_img = cv2.threshold(img, 190, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)

hsv = vsv = 25
out_img = rlsa(binary_img, hsv, vsv, hsv//10)With a similar setup, the other functions can be used like so:out_img = rlsa_horizontal(binary_img, hsv)
out_img = rlsa_vertical(binary_img, vsv)ResultsInput imageAfter RLSAHorizontal onlyVertical onlyIncluded scriptsA few scripts are included in the tests folder. One is a python implementation of rlsa, serving as reference. The other two compare the result and speed of the implementations.To run the those scripts, you need to install opencv.Testpython -m tests.test assets/rlsa_test_image.jpgBenchmarkpython -m tests.benchmark assets/rlsa_test_image.jpg--> C version is around 400 times faster than the naive python one.MiscNote: the numpy tutorial/dochereis (it seems) outdated (be carefull when using it).
Package: rlschool
RLSchoolRLSchool provides abundant environments for benchmarking Reinforcement Learning and Meta Reinforcement LearningEnvironments UpdatingLiftSim：Simulator for Evelvator Dispatching (Sep, 2019)Quadrotor: 3D Quadrotor simulator for different tasks (Mar, 2020)Quadrupedal: Quadrupedal robot adapting to different terrains (Seq, 2021)MetaMaze: Meta maze environment for 3D visual navigation (Oct, 2021)Navigator2D: Simple 2D navigator meta environment (Oct, 2021)
Package: rlskyjo
skyjo_rlMulti-Agent Reinforcement Learning Environment for the card game SkyJo, compatible with PettingZoo and RLLIBRead the docsProject OrganizationGithub Repository├── LICENSE
├── Makefile                <- Makefile with commands like `make data` or `make train`
├── README.md               <- The top-level README for developers using this project.
│
├── docs                    <- Docs HTMLs, see Sphinx [docs](https:/michaelfeil.github.io/skyjo_rl)
│
├── models                  <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks               <- Jupyter notebooks. 
├── requirements.txt                        <- requirements for the rlskyjo
├── requirements_dev.txt                    <- requirements for developers
├── rlskyjo                                    
│   ├── environment
│   │   ├── skyjo_env.py
│   │   └── vanilla_env_example.py
│   ├── game
│   │   ├── sample_game.py
│   │   └── skyjo.py
│   ├── models
│   │   ├── action_mask_model.py
│   │   ├── random_admissible_policy.py
│   │   └── train_model_simple_rllib.py
│   └── utils.py
├── setup.py                                <- makes project pip installable (pip install -e .) so skyjo_rl can be imported
├── test_environment.py
├── tests                                   <- Unittests
└── tox.ini                                 <- tox file with settings for running tox; see tox.readthedocs.ioPYPI Installconda create --name skyjo python=3.8 pip
conda activate skyjo
pip install rlskyjoDeveloper Installgit clone https://github.com/michaelfeil/skyjo_rl.git
conda create --name skyjo python=3.8 pip
conda activate skyjo
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install -e .
pre-commit install
coverage run -m --source=./rlskyjo pytest testsTutorialsVanilla SkyJo PettingZoo Env exampleSkyJo game exampleTrain PPO MultiAgent with SkyJo PettingZoo Env, Pytorch and RLLib
Package: rlssm
rlssmrlssmis a Python package for fitting reinforcement learning (RL) models,
sequential sampling models (DDM, RDM, LBA, ALBA, and ARDM),
and combinations of the two, using Bayesian parameter estimation.Parameter estimation is done at an individual or hierarchical level
usingPyStan, the Python Interface to Stan.
Stan performs Bayesian inference using the No-U-Turn sampler,
a variant of Hamiltonian Monte Carlo.DocumentationThe latest documentation can be found here:https://rlssm.readthedocs.io/Licenserlssmis licensed under the terms of the MIT license. See the file
“LICENSE” for information on the history of this software, terms & conditions
for usage, and a DISCLAIMER OF ALL WARRANTIES.All trademarks referenced herein are property of their respective holders.Copyright (c) 2021–, Laura Fontanesi,
University of Basel.
Package: rlstatsdb
Installpip install rlstatsdbDescriptionrlstatsdbis a simple and easy-to-implement SQLite database manager equipped for storing and fetching Rocket League replay data (as returned from ballchasing.com's API). When fetching data from the database (through the manager) is incredibly easy to navigate, meaning you don't need to memorize the entire dictionary structure of ballchasing's get-replay response.UsageFor the below example,replay_datais the response dict fromhttps://ballchasing.com/api/replays/<replay_id>. In reality, this can be acquired through various means, such asrequestsandaiohttp, or through API wrappers such aspychasingandpython-ballchasing.importrlstatsdb# The database file needs to either be non-existant, empty, or a valid# SQLite database. If the file is non-existant, a new file will be createdsdb=rlstatsdb.Manager("path_to_database_file")manifest_id=sdb.add(replay_data)game=sdb.get(manifest_id)game.replay_idgame.max_rank.divisiongame.orange.players[0].stats.core.goalsgame.blue.color# etc.
Package: rltg
RLTGFramework for Reinforcement Learning with Temporal Goals defined by LDLf formulas.Free software: MIT licenseDocumentation:https://rltg.readthedocs.io.FeaturesEffective Modularization of a Reinforcement Learning system;Easy setup of the “training loop”;RL algorithms (here “Brain”) supported: Sarsa and QLearning multi-stepExploration policy supported: random policy;Support for temporal goal defined by LDLf formulas.ExamplesTo see some example, please refer torltg-examples.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-04-04)First release on PyPI.
Package: rlt-json-tools
JSON ToolsCollection of JSON tools for Python 3 that help developers work with JSON (Javascript Object Notation) easier.The source for this project is available here.OverviewFrozenJSONAllows a JSON to be loaded into a pseudo python object dynamically.This idea and conception was from the book"Fluent Python: Clear, Concise, and Effective Programming" by Luciano Ramalho.Basic UsageFor example, say we have a JSON in a file that looks like the following:{"_id":"5e52d75618947399f093ac7d","isActive":false,"picture":"http://placehold.it/32x32","latitude":-49.694182,"longitude":126.901299,"tags":["non","est","sint"]}If a developer wanted to treat this JSON as a python object, they could create a FrozenJSON
using the following syntax:importFrozenJSONx=Frozen.of(<file_path>)print(x.isActive)...Falseprint(x.tags)...["non","est","sint"]print(x.tags[0])..."non"Theofmethod is a dynamic constructor that is able to discern whether the data passed in a JSON string, the path to a file, a reference to a file itself, or a python dictionary.So something like below is perfectly legal:importFrozenJSONdata={"name":"Ryan Long","class":"Geometry"}x=FrozenJSON.of(data)print(x.name)..."Ryan Long"print(x.class_)..."Geometry"Notice that althoughclassis a keyword, FrozenJSON is still able to assign it to a key by
appending "_" to the end.  This is true for all python keywords that are also used as keys
and happens automatically.
Package: rltk
The Record Linkage ToolKit (RLTK) is a general-purpose open-source record linkage platform that allows users to build powerful Python programs that link records referring to the same underlying entity. Record linkage is an extremely important problem that shows up in domains extending from social networks to bibliographic data and biomedicine. Current open platforms for record linkage have problems scaling even to moderately sized datasets, or are just not easy to use (even by experts). RLTK attempts to address all of these issues.RLTK supports a full, scalable record linkage pipeline, including multi-core algorithms for blocking, profiling data, computing a wide variety of features, and training and applying machine learning classifiers based on Python’s sklearn library. An end-to-end RLTK pipeline can be jump-started with only a few lines of code. However, RLTK is also designed to be extensible and customizable, allowing users arbitrary degrees of control over many of the individual components. You can add new features to RLTK (e.g. a custom string similarity) very easily.RLTK is being built by theCenter on Knowledge GraphsatUSC/ISI, with funding from multiple projects funded by the DARPA LORELEI and MEMEX programs and the IARPA CAUSE program.
RLTK is under active maintenance and we expect to keep adding new features and state-of-the-art record linkage algorithms in the foreseeable future, in addition to continuously supporting our adopters to integrate the platform into their applications.Getting StartedInstallation (make sure prerequisites are installed):pip install -U rltkExample:>>> import rltk
>>> rltk.levenshtein_distance('abc', 'abd')
1Try RLTK OnlineStable versionDevelopment versionDatasets & Experimentsrltk-experimentationDocumentationTutorialsAPI Reference
Package: rl-tools
rl-toolsThis is a simple toolset for reinforcement learning (RL).Installationfrom PIPpip install rl_toolsfrom sourcepythonsetup.pyinstallUsageAs a alone script:for example:python -m rl_tools.plotter --save --showenjoy.pyenjoy the trained model, and track avg, med, std, min, max reward of episodes.plotter.pyplot learning curves for training , seerl-plotterfor detail.scheduler.pyset training scheduler for tasks.In RL agent:for example:from rl_tools.evaluator import Evaluator
from rl_tools.logger import Loggerevaluator.pyevaluate model while training.logger.pytrack learning process while training (same format as OpenAI baseline).
Package: rltorch
rltorch(WIP)rltorch provides a simple framework for reinforcement learning in PyTorch. You can easily implement distributed RL algorithms.InstallationInstall rltorch from source.git clone https://github.com/ku2482/rltorch.git
cd rltorch
pip install -e .You can also install using PyPI.pip install rltorchExamplesApe-XYou can implement Ape-X[1]agent like this examplehere.python examples/atari/apex.py \
[--env_id str(default MsPacmanNoFrameskip-v4)] \
[--num_actors int(default 4)] [--cuda (optional)] \
[--seed int(default 0)]Soft Actor-CriticYou can implement Soft Actor-Critic[2, 3]agent like this examplehere. Note that you needa licenseandmujoco_pyto be installed.python examples/mujoco/sac.py \
[--env_id str(default HalfCheetah-v2)] \
[--num_actors int(default 1)] \
[--cuda (optional)] [--seed int(default 0)]SAC-DiscreteYou can implement SAC-Discrete[4]agent like this examplehere.python examples/mujoco/sac.py \
[--env_id str(default MsPacmanNoFrameskip-v4)] \
[--num_actors int(default 4)] \
[--cuda (optional)] [--seed int(default 0)]References[1]Horgan, Dan, et al. "Distributed prioritized experience replay." arXiv preprint arXiv:1803.00933 (2018).[2]Haarnoja, Tuomas, et al. "Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor." arXiv preprint arXiv:1801.01290 (2018).[3]Haarnoja, Tuomas, et al. "Soft actor-critic algorithms and applications." arXiv preprint arXiv:1812.05905 (2018).[4]Christodoulou, Petros. "Soft Actor-Critic for Discrete Action Settings." arXiv preprint arXiv:1910.07207 (2019).