<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> from rlpy . Domains import InfCartPoleBalance <EOL> from rlpy . Agents import Greedy_GQ , SARSA , Q_Learning <EOL> from rlpy . Representations import * <EOL> from rlpy . Policies import eGreedy <EOL> from rlpy . Experiments import Experiment <EOL> import numpy as np <EOL> from hyperopt import hp <EOL> param_space = { '<STR_LIT>' : hp . quniform ( "<STR_LIT>" , <NUM_LIT:5> , <NUM_LIT> , <NUM_LIT:1> ) , <EOL> '<STR_LIT>' : <EOL> hp . loguniform ( <EOL> "<STR_LIT>" , <EOL> np . log ( <NUM_LIT> ) , <EOL> np . log ( <NUM_LIT> ) ) , <EOL> '<STR_LIT>' : hp . loguniform ( "<STR_LIT>" , np . log ( <NUM_LIT> ) , np . log ( <NUM_LIT> ) ) , <EOL> '<STR_LIT>' : hp . loguniform ( "<STR_LIT>" , np . log ( <NUM_LIT> ) , np . log ( <NUM_LIT:1> ) ) } <EOL> def make_experiment ( <EOL> exp_id = <NUM_LIT:1> , path = "<STR_LIT>" , <EOL> discover_threshold = <NUM_LIT> , <EOL> lambda_ = <NUM_LIT:0.> , <EOL> boyan_N0 = <NUM_LIT> , <EOL> initial_learn_rate = <NUM_LIT> , <EOL> discretization = <NUM_LIT> ) : <EOL> opt = { } <EOL> opt [ "<STR_LIT:path>" ] = path <EOL> opt [ "<STR_LIT>" ] = exp_id <EOL> opt [ "<STR_LIT>" ] = <NUM_LIT> <EOL> opt [ "<STR_LIT>" ] = <NUM_LIT:20> <EOL> opt [ "<STR_LIT>" ] = <NUM_LIT:10> <EOL> sparsify = True <EOL> kappa = <NUM_LIT> <EOL> domain = InfCartPoleBalance ( ) <EOL> opt [ "<STR_LIT>" ] = domain <EOL> initial_rep = IndependentDiscretization ( <EOL> domain , <EOL> discretization = discretization ) <EOL> representation = iFDD ( domain , discover_threshold , initial_rep , <EOL> sparsify = sparsify , <EOL> discretization = discretization , <EOL> useCache = True , <EOL> iFDDPlus = <NUM_LIT:1> - kappa ) <EOL> policy = eGreedy ( representation , epsilon = <NUM_LIT:0.1> ) <EOL> opt [ "<STR_LIT>" ] = Q_Learning ( policy , representation , <EOL> discount_factor = domain . discount_factor , <EOL> lambda_ = lambda_ , <EOL> initial_learn_rate = initial_learn_rate , <EOL> learn_rate_decay_mode = "<STR_LIT>" , boyan_N0 = boyan_N0 ) <EOL> experiment = Experiment ( ** opt ) <EOL> return experiment <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> experiment = make_experiment ( <NUM_LIT:1> ) <EOL> experiment . run ( ) <EOL> experiment . save ( ) </s>
