def test(file_name,data_new,targets,actions,vel): ####################### target_dist = 30 target_var = 50000 ####################### max_velocity = 0.31 learning_rate = 0.1 if network == 'GRP': f1 = GRP((2,360),(1,361),(1,360),(1,1),True,True,max_velocity,file_name = file_name) return f1.test_network(data_new,targets,actions,vel,True) elif network == 'action': f1 = action_predicter((2,360),(1,361),(1,360),(1,1),True,True,max_velocity,file_name = file_name) return f1.test_network(data_new,targets,actions,vel,True) elif network == 'action_m': f1 = action_modified((2,360),(1,361),(1,360),(1,1),True,True,max_velocity) return f1.test_network(data_new,targets,actions,vel,True) else: sys.exit(1)
def train(file_name, data_new,targets,actions,cosined_actions,vel,dist=0.2): ####################### target_dist = 30 target_var = 50000 ####################### max_velocity = 0.31 learning_rate = 0.1 if network == 'GRP': f1 = GRP((2,360),(1,361),(1,360),(1,1),False,False,max_velocity,file_name=file_name, safe_dist=dist) f1.train_network(data_new,targets,cosined_actions,vel,actions) elif network == 'action': f1 = action_predicter((2,360),(1,361),(1,360),(1,1),False,False,max_velocity,file_name=file_name, safe_dist=dist) #print(len(data_new), sum(len(data_new[k]) for k in data_new)) f1.train_network(data_new,targets,cosined_actions,vel,actions) elif network == 'action_m': f1 = action_modified((2,360),(1,361),(1,360),(1,1),False,False,max_velocity) f1.train_network(data_new,targets,cosined_actions,vel,actions) else: sys.exit(1)
def train(file_name, data_new, targets, actions, cosined_actions, vel): ####################### target_dist = 30 target_var = 50000 ####################### max_velocity = 0.31 learning_rate = 0.1 if network == 'GRP': f1 = GRP((2, 360), (1, 361), (1, 360), (1, 1), False, False, max_velocity, file_name=file_name) f1.train_network(data_new, targets, cosined_actions, vel, actions) elif network == 'action_m': f1 = action_modified((2, 360), (1, 361), (1, 360), (1, 1), False, False, max_velocity) f1.train_network(data_new, targets, cosined_actions, vel, actions) else: sys.exit(1)
#print('Testing system is still being built') #sys.exit(1) ####################### #network_list = ['action+','action','feature','GRP','GRP+','GRP_feature'] if network == 'GRP': f1 = GRP((2,360),(1,361),(1,360),(1,1),load_network,False,max_velocity) f1.train_network(data_new,targets,cosined_actions,vel) elif network == 'action+': f1 = action_predicter_f((3,360),(1,361),(1,360),(1,1),load_network,False,max_velocity) f1.train_network(data_new,targets,cosined_actions,vel) elif network == 'action': f1 = action_predicter((2,360),(1,361),(1,360),(1,1),load_network,False,max_velocity) f1.train_network(data_new,targets,cosined_actions,vel) elif network == 'action_m': f1 = action_modified((2,360),(1,361),(1,360),(1,1),load_network,False,max_velocity) f1.train_network(data_new,targets,actions,vel) elif network == 'feature': f1 = feature_predicter_ours((2,360),(1,361),load_network,False,0.7) f1.train_network(data_new,targets) elif network == 'GRP_feature': f1 = feature_predicter_GRP((1,360),(1,360),load_network,False,0.7) f1.train_network(data_new,target_obs) elif network == 'GRP+': f1 = GRP_f((1,360),(1,360),load_network,False,0.7) f1.train_network(data_new,target_obs) else: sys.exit(1)
elif load_network == 'n' or load_network == 'N': load_network = True else: 'Failed to provide input' sys.exit(1) """ #print('Testing system is still being built') #sys.exit(1) ####################### if network == 'GRP': f1 = GRP((2, 360), (1, 361), (1, 360), (1, 1), True, True, max_velocity) f1.test_network(data_new, targets, actions, vel) elif network == 'action+': f1 = action_predicter_f((2, 360), (1, 361), (1, 360), (1, 1), True, True, max_velocity) f1.test_network(data_new, targets, actions, vel) elif network == 'action': f1 = action_predicter((2, 360), (1, 361), (1, 360), (1, 1), True, True, max_velocity) f1.test_network(data_new, targets, actions, vel) elif network == 'action_m': f1 = action_modified((2, 360), (1, 361), (1, 360), (1, 1), True, True, max_velocity) f1.test_network(data_new, targets, actions, vel) elif network == 'GRP+': f1 = GRP_f((1, 360), (1, 360), (1, 32), (1, 1), True, True, max_velocity) f1.test_network(data_new, targets, actions, vel) else: sys.exit(1)