예제 #1
0
experiment = Experiment(1)
experiment.log_code()

# Experiment 1
N = 50
epsilon = .3
simulations = 10000
T = 400
algorithms = [
    GeneralCausal(truncate='None'),
    ParallelCausal(),
    SuccessiveRejects(),
    AlphaUCB(2),
    ThompsonSampling()
]
m_vals = range(2, N, 2)

regret, models = regret_vs_m(algorithms,
                             m_vals,
                             N,
                             T,
                             epsilon,
                             simulations=simulations)

experiment.plot_regret(regret,
                       m_vals,
                       "m",
                       algorithms,
                       legend_loc="lower right")
experiment.log_state(globals())
예제 #2
0
"""

from experiment_config import Experiment

e = Experiment(1)


def returnthing():
    return 5


v1 = 4
v2 = [1, 2, 3]
x = returnthing()

e.log_state(globals())

del v1
del v2
del x

d = e.read_state(e.state_filename)

#import shelve
#d = {}
#db = shelve.open(e.state_filename)
#for key in db:
#
#    value = db[key]
#    d[key] = value
#    globals()[key] = value