simple_rl.experiments package

Submodules

simple_rl.experiments.ExperimentClass module

ExperimentClass.py: Contains the Experiment Class for reproducing RL Experiments.

Purpose:
  • Stores all relevant parameters in experiment directory for easy reproducibility.
  • Auto generates plot using chart_utils.
  • Can document learning activity.
class simple_rl.experiments.ExperimentClass.Experiment(agents, mdp, agent_colors=[], params=None, is_episodic=False, is_markov_game=False, is_lifelong=False, track_disc_reward=False, clear_old_results=True, count_r_per_n_timestep=1, cumulative_plot=True, exp_function='run_agents_on_mdp', dir_for_plot='', experiment_name_prefix='')[source]

Bases: object

EXP_PARAM_FILE_NAME = 'exp_info.txt'

Experiment Class for RL Experiments

FULL_EXP_FILE_NAME = 'full_experiment.txt'
RESULTS_DIR = '/Users/dabel/Research/simple_rl/docs/sphinx/results/'
add_experience(agent, state, action, reward, next_state, time_taken=0)[source]
Args:
agent (agent OR dict): if self.is_markov_game, contains a dict of agents
Summary:
Record any relevant information about this experience.
end_of_episode(agent, num_times_to_write=1)[source]
Args:
agent (str)
Summary:
Writes reward data from this episode to file and resets the reward.
end_of_instance(agent)[source]
Summary:
Adds a new line to indicate we're onto a new instance.
get_agent_avg_cumulative_rew(agent)[source]
make_plots(open_plot=True)[source]
Summary:
Makes plots for the current experiment.
write_datum_to_file(agent, datum, extra_dir='')[source]
Summary:
Writes datum to file.
write_exp_info_to_file()[source]
Summary:
Writes relevant experiment information to a file for reproducibility.

simple_rl.experiments.ExperimentParametersClass module

ExperimentParametersClass.py: Contains the ExperimentParameters Class.

Purpose: Bundles all relevant parameters into an object that can be written to a file.

class simple_rl.experiments.ExperimentParametersClass.ExperimentParameters(params={})[source]

Bases: object

Parameters object given to @ExperimentClass instances. Used for storing all relevant experiment info for reproducibility.

Module contents