saveNet = False saveName = "grasp.wgt" numbExp = 1 #number of experiments for runs in range(numbExp): # create environment #Options: XML-Model, Bool(OpenGL), Bool(Realtime simu. while client is connected), ServerIP(default:localhost), Port(default:21560) env = CCRLEnvironment() # create task task = CCRLGlasVarTask(env) # create controller network net = buildNetwork(len(task.getObservation()), hiddenUnits, env.actLen, outclass=TanhLayer) # create agent with controller and learner agent = FiniteDifferenceAgent(net, SPLA()) # learning options agent.learner.gd.alpha = 0.2 #step size of \mu adaption agent.learner.gdSig.alpha = 0.085 #step size of \sigma adaption agent.learner.gd.momentum = 0.0 #Loading weights if loadNet: agent.learner.original = loadWeights("grasp.wgt") agent.learner.gd.init(agent.learner.original) agent.learner.epsilon = 0.2 agent.learner.initSigmas() batch = 2 #number of samples per gradient estimate #create experiment experiment = EpisodicExperiment(task, agent)
filepointer = file(filename, 'w+') dump(w, filepointer) filepointer.close() numbExp = 1 #number of experiments for runs in range(numbExp): # create environment #Options: Bool(OpenGL), Bool(Realtime simu. while client is connected), ServerIP(default:localhost), Port(default:21560) env = ShipSteeringEnvironment(False) # create task task = GoNorthwardTask(env, maxsteps=500) # create controller network net = buildNetwork(task.outdim, task.indim, outclass=TanhLayer) # create agent with controller and learner agent = FiniteDifferenceAgent(net, SimpleSPSA()) # learning options agent.learner.gd.alpha = 0.5 #step size of parameter adaption agent.learner.gamma = 0.9993 #exploration decay factor agent.learner.gd.momentum = 0.0 batch = 2 #number of samples per gradient estimate (Symetric sampling needs odd number of samples per estimate!) #create experiment experiment = EpisodicExperiment(task, agent) prnts = 10 #frequency of console output epis = 10000 / batch / prnts #actual roll outs #filename="dataSPLA08NoRew"+repr(int(random.random()*1000000.0))+".dat" #wf = open(filename, 'wb') for updates in range(epis): for i in range(prnts):