Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statisticalrl_experiments-2.2507.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statisticalrl_experiments-2.2507-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file statisticalrl_experiments-2.2507.tar.gz.

File metadata

File hashes

Hashes for statisticalrl_experiments-2.2507.tar.gz
Algorithm Hash digest
SHA256 4513b87f24d2ace5ea87d88c9828b57c9ab529ec8ed36d187e8cf29cbc4ee434
MD5 801728da83c76d14d2a760bbb2b371cb
BLAKE2b-256 2c6c3b2788ca810f95738c4046c91757b3cb21c4d00b901bc200b6f2660724ac

See more details on using hashes here.

File details

Details for the file statisticalrl_experiments-2.2507-py3-none-any.whl.

File metadata

File hashes

Hashes for statisticalrl_experiments-2.2507-py3-none-any.whl
Algorithm Hash digest
SHA256 f12e149090dad917765cb02829f9ba5e58dc2538ec3d4ef5136df3da21892bc5
MD5 a3b0ed58f1254345149a34c404ce4b46
BLAKE2b-256 adf047066d9cca3b53a94c28ce665b3d90114f3568106d2073e932af41472b13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page