semvec/pypi-packages huggingface dataset:
statisticalRL-experiments 2.2507
Experimentation backbone for the Statistical Reinforcement Learning project
License: MIT
Requires Python: >=3.8

# 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)
statisticalRL-learners 2.2507
Learners for the Statistical Reinforcement Learning project
License: MIT
Requires Python: >=3.8

# Learners
Learning Agents for Statistical Reinforcement Learning


## Installation

    pip install statisticalRL-learners


## Test
You need to install statisticalRL-environments and statisticalRL-experiments before testing.

    pip install statisticalRL-environments
    pip install statisticalRL-experiments


# List of learners:
    
    
    Random
    Human
    Uniform

    MABs:
        MABOracle
        FTL
        UCB
        TS
        IMED
        BESA
    MDPs_dicrete:
        MDPOracle
        QLearning
        AdaQLearning
        IMED-RL
        KL-UCRL
        MED-RL
        PSRL
        UCRL2
        UCRL2.2
        UCRL2B
        UCRL2B-detR
        UCRL3
        UCRL3-lazy
        Known dynamics:
            IMED-KD
            PSRL-KD
            TS-KD
            UCB-KD
            UCRL3-KD
            UCRL3-KD-lazy
        Equivalence structure:
            CUCRL
            CUCRL-detR
            UCRL_SA_oracle
            UCRL_SA


# Usage

You can run an instance of a learner on an environment from StatisticalRL library.