Skip to content

Instantly share code, notes, and snippets.

View cvigoe's full-sized avatar

Conor Igoe cvigoe

  • Carnegie Mellon University
  • Pittsburgh
View GitHub Profile
NUM_ALGO_TRIALS = _
NUM_TRAINING_TIMESTEPS = _
NUM_TESTING_TIMESTEPS = _
set_seed()
for algo_iteration in range(NUM_ALGO_TRIALS):
for training_timesteps in range(NUM_TRAINING_TIMESTEPS): #for epsiodic tasks, keep resetting the env
deploy_policy_with_exploration()
update_policy_with_new_data()
for testing_timesteps in range(NUM_TESTING_TIMESTEPS): #for epsiodic tasks, keep resetting the env
@cvigoe
cvigoe / RL_plot.py
Created June 25, 2020 21:59
High Level RL Plotting Process
NUM_ALGO_TRIALS = _
NUM_TRAINING_TIMESTEPS = _
NUM_TESTING_TIMESTEPS = _
set_seed()
for algo_iteration in range(NUM_ALGO_TRIALS):
for training_timesteps in range(NUM_TRAINING_TIMESTEPS): #for epsiodic tasks, keep resetting the env
deploy_policy_with_exploration()
update_policy_with_new_data()
for testing_timesteps in range(NUM_TESTING_TIMESTEPS): #for epsiodic tasks, keep resetting the env
@cvigoe
cvigoe / sim.py
Created December 17, 2019 22:08
example of the simulator code structure
def simulator(initial_state, parameter):
state = initial_state
for t in range(timesteps):
state = next_state(state,parameter)
print(state)
#############################################
# but I need to be able to do something like
@cvigoe
cvigoe / model.py
Created October 25, 2017 23:53
PyMC3 Bayesian model with NaN and Zero MCMC Posterior Predictive Distribution samples
#######################################################################################################################
# Simulation of Bayesian Dwell Time Model Assuming Error-free Covariates
# Conor Igoe - 2017
#
# Loads relevant data from the test directory given by test_data_filepath
# Initialises the necessary data structures for PyMC3 and logging
# Steps through the loaded test data chronologically
# For the 1st data point, with no posteriors to use as priors for the model, uses uniform priors
# For all other data points, uses posteriors from the previous datapoint as priors for current point in simulation
# Calculates the likelihood