Experimentation backbone for the Statistical Reinforcement Learning project
Project description
Experiments
Experimentations with Learning Agents run on Statistial Reinforcement Learning environments.
Installation
pip install statisticalRL-experiments
Usage
from statisticalrl_experiments.fullExperiment import runLargeMulticoreExperiment as xp
#######################
# Import registered environments
import statisticalrl_environments.register as bW
#######################
# Instantiate one environment
env = bW.make('river-swim-6')
nS = env.observation_space.n
nA = env.action_space.n
#######################
# Import some learners
from statisticalrl_learners.Generic.Random import Random as rd
from statisticalrl_learners.Generic.Qlearning import Qlearning as ql
from statisticalrl_learners.MDPs_discrete.UCRL3 import UCRL3_lazy as ucrl3
from statisticalrl_learners.MDPs_discrete.IMED_RL import IMEDRL as imedrl
import statisticalrl_learners.MDPs_discrete.Optimal.OptimalControl as opt
#######################
# List a few learners to be compared:
agents = []
agents.append( [rd, {"env": env}])
agents.append( [ql, {"nS":nS, "nA":nA}])
agents.append( [ucrl3, {"nS":nS, "nA":nA, "delta":0.05}])
agents.append(([imedrl, {"nbr_states":nS, "nbr_actions":nA}]))
#############################
# Compute oracle policy:
oracle = opt.build_opti(env.name, env, env.observation_space.n, env.action_space.n)
#######################
# Run a full experiment
# This function produces all results including plots, logs, etc in the folder "root_folder"
#######################
xp(env, agents, oracle, timeHorizon=1000, nbReplicates=16,root_folder="results/")
#######################
# Plotting Regret directly from dump files of past runs (here until time horizon tplot=500):
#######################
#from statisticalrl_experiments.plotResults import search_dump_cumRegretfiles, plot_results_from_dump
#files = search_dump_cumRegretfiles("RiverSwim-S6-v0", root_folder="results/")
#if files:
# plot_results_from_dump(files, tplot=500)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file statisticalrl_experiments-2.2507.tar.gz.
File metadata
- Download URL: statisticalrl_experiments-2.2507.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4513b87f24d2ace5ea87d88c9828b57c9ab529ec8ed36d187e8cf29cbc4ee434
|
|
| MD5 |
801728da83c76d14d2a760bbb2b371cb
|
|
| BLAKE2b-256 |
2c6c3b2788ca810f95738c4046c91757b3cb21c4d00b901bc200b6f2660724ac
|
File details
Details for the file statisticalrl_experiments-2.2507-py3-none-any.whl.
File metadata
- Download URL: statisticalrl_experiments-2.2507-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f12e149090dad917765cb02829f9ba5e58dc2538ec3d4ef5136df3da21892bc5
|
|
| MD5 |
a3b0ed58f1254345149a34c404ce4b46
|
|
| BLAKE2b-256 |
adf047066d9cca3b53a94c28ce665b3d90114f3568106d2073e932af41472b13
|