def __init__(self, create_model, args, rank, gpu_id): max_episode_length = args.max_episode_length hidden_state_sz = args.hidden_state_sz self.action_space = args.action_space from utils.class_finder import episode_class episode_constructor = episode_class(args.episode_type) episode = episode_constructor(args, gpu_id, args.strict_done) super(NavigationAgent, self).__init__(create_model(args), args, rank, episode, max_episode_length, gpu_id) self.hidden_state_sz = hidden_state_sz
def __init__(self, create_model, args, rank, scenes, targets, gpu_id): max_episode_length = args.max_episode_length hidden_state_sz = args.hidden_state_sz self.action_space = args.action_space from utils.class_finder import episode_class episode_constructor = episode_class(args.episode_type) episode = episode_constructor(args, gpu_id, args.strict_done) super(NavigationAgent, self).__init__(create_model(args), args, rank, scenes, targets, episode, max_episode_length, gpu_id) self.hidden_state_sz = hidden_state_sz self.keep_ori_obs = args.keep_ori_obs self.glove = {} if 'SP' in self.model_name: with h5py.File('/home/dhm/Code/vn/glove_map300d.hdf5', 'r') as rf: for i in rf: self.glove[i] = rf[i][:]