def run(regressionSetup, delay):

    stateAndCommand, nextState = loadTrajForModel(pathDataFolder + "Brent/",
                                                  delay)

    print("nombre d'echantillons: ", len(stateAndCommand))

    fa = regressionDict[regressionSetup.regression](regressionSetup)
    fa.getTrainingData(stateAndCommand, nextState)
    fa.train()
def run(regressionSetup, delay):
    
    
    stateAndCommand, nextState = loadTrajForModel(pathDataFolder + "Brent/", delay)

    
    
    
    print("nombre d'echantillons: ", len(stateAndCommand))

    fa = regressionDict[regressionSetup.regression](regressionSetup)
    fa.getTrainingData(stateAndCommand, nextState)
    fa.train()
Exemple #3
0
foldername = rs.CMAESpath + str(0.04) + "/"
thetaname = foldername + rs.thetaFile
exp = Experiments(rs, 0.04, False, foldername, thetaname,rs.popsizeCmaes,rs.period, "Inv")
#exp2 = Experiments(rs, 0.04, False, foldername, thetaname,rs.popsizeCmaes,rs.period,"Reg")
exp3 = Experiments(rs, 0.04, False, foldername, thetaname,rs.popsizeCmaes,rs.period,"Hyb")

'''
c=Chrono()
for i in range(30):
    cost, time = exp.runMultiProcessTrajectories(10)
c.stop()
print("Average cost: ", cost)
print("Average time: ", time)
'''
stateAndCommand, nextState = loadTrajForModel(pathDataFolder + "Brent/", 10)
#stateAndCommand, nextState = loadTrajForModel(pathDataFolder + "CMAEScluster/0.02/cluster/Log/", 10)
state=stateAndCommand[:,:4]
command=stateAndCommand[:,4:]

#exp2.tm.stateEstimator.initStore(state)
exp3.tm.stateEstimator.initStore(state)

nbE=0
error=np.zeros(4)
c=Chrono()
for i in range(state.shape[0]):
    if(state[i][0]==0 and state[i][1]==0):
        exp.tm.stateEstimator.initStore(state[i])
        tmp=0
    inferredState = exp.tm.stateEstimator.getEstimState(state[i], command[i][:6])