TAXONS  0.1
Task Agnostic eXploration of Outcome spaces through Novelty and Surprise
test_control Namespace Reference

Classes

class  Eval
 

Variables

int seed = 42
 
string load_path = '/home/giuseppe/src/taxons/experiments/Maze_AE_Mixed/{}'
 
 params = parameters.Params()
 
 env = gym.make(params.env_tag)
 
list target_pose = [450, 500]
 
 obs = env.reset(desired_ball_pose=target_pose)
 
 target_image = env.render(mode='rgb_array')
 
 qpos = np.zeros(15)
 
 qvel = np.zeros(14)
 
 pose = target_pose+env.initPos[-1:]
 
 p = fs.Posture(*pose)
 
 device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
 selector = ae.ConvAE(device=device, encoding_shape=params.feature_size)
 
 agent_type = agents.FFNeuralAgent
 
 pop = population.Population(agent=agent_type, pop_size=0, shapes=params.agent_shapes)
 
bool done = False
 
int t = 0
 
 agent_input = t
 
 action = utils.action_formatting(params.env_tag, agent['agent'](agent_input))
 
 reward
 
 info
 
 CoM = np.array([env.env.data.qpos[:2]])
 
 state = env.render(mode='rgb_array')
 
 surprise
 
 bs_point = bs_point.flatten().cpu().data.numpy()
 
 y
 
 goal = torch.Tensor(np.ascontiguousarray(target_image)).permute(2, 0, 1).unsqueeze(0).to(device)
 
 reconstr
 
 bs_space = np.stack([a[0] for a in pop['features'].values])
 
 diff = np.atleast_2d(bs_space - bs_point)
 
 dists = np.sqrt(np.sum(diff * diff, axis=1))
 
 closest_agent = np.argmin(dists)
 
 selected = pop[closest_agent]
 
list images = []
 
list saved_balls_pose = []
 
list saved_joints_pose = []
 
list saved_robot_pose = []
 
 f_pose = CoM
 
 SHOW_ARM_IN_ARRAY
 
 point_pose
 
 final_distance = np.sqrt(np.sum((target_pose - f_pose) ** 2))
 

Variable Documentation

test_control.action = utils.action_formatting(params.env_tag, agent['agent'](agent_input))
list test_control.agent_input = t
test_control.agent_type = agents.FFNeuralAgent
test_control.bs_point = bs_point.flatten().cpu().data.numpy()
test_control.bs_space = np.stack([a[0] for a in pop['features'].values])
test_control.closest_agent = np.argmin(dists)
test_control.CoM = np.array([env.env.data.qpos[:2]])
test_control.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
test_control.diff = np.atleast_2d(bs_space - bs_point)
test_control.dists = np.sqrt(np.sum(diff * diff, axis=1))
bool test_control.done = False
test_control.env = gym.make(params.env_tag)
test_control.f_pose = CoM
test_control.final_distance = np.sqrt(np.sum((target_pose - f_pose) ** 2))
test_control.goal = torch.Tensor(np.ascontiguousarray(target_image)).permute(2, 0, 1).unsqueeze(0).to(device)
test_control.images = []
test_control.info
string test_control.load_path = '/home/giuseppe/src/taxons/experiments/Maze_AE_Mixed/{}'
test_control.obs = env.reset(desired_ball_pose=target_pose)
test_control.p = fs.Posture(*pose)
test_control.params = parameters.Params()
test_control.point_pose
Initial value:
1 = np.array([np.sin(saved_joints_pose[:, 0]) + .9 * np.cos(np.pi / 2. - saved_joints_pose[:, 1] - saved_joints_pose[:, 0]),
2  np.cos(saved_joints_pose[:, 0]) + .9 * np.sin(np.pi / 2. - saved_joints_pose[:, 1] - saved_joints_pose[:, 0])]).transpose()
test_control.pop = population.Population(agent=agent_type, pop_size=0, shapes=params.agent_shapes)
test_control.pose = target_pose+env.initPos[-1:]
test_control.qpos = np.zeros(15)
test_control.qvel = np.zeros(14)
test_control.reconstr
test_control.reward
test_control.saved_balls_pose = []
test_control.saved_joints_pose = []
int test_control.saved_robot_pose = []
int test_control.seed = 42
test_control.selected = pop[closest_agent]
test_control.selector = ae.ConvAE(device=device, encoding_shape=params.feature_size)
test_control.SHOW_ARM_IN_ARRAY
int test_control.state = env.render(mode='rgb_array')
test_control.surprise
int test_control.t = 0
test_control.target_image = env.render(mode='rgb_array')
list test_control.target_pose = [450, 500]
test_control.y