Exemplo n.º 1
0
    def __init__(self, path, device):
        self.params = parameters.Params()
        self.params.load(os.path.join(path, 'params.json'))

        print('Loading metric...')
        self.selector = ae.ConvAE(device=device,
                                  encoding_shape=self.params.feature_size,
                                  learning_rate=0.0001,
                                  beta=1)

        self.selector.load(os.path.join(path, 'models/ckpt/ckpt_ae.pth'))
        self.selector.training = False
Exemplo n.º 2
0
        u_limit = 600
        l_limit = 0
    else:
        u_limit = 1.35
        l_limit = -u_limit

    utils.show(bs_points,
               filepath=params.save_path,
               name='final_{}_{}'.format(evolver.elapsed_gen, params.env_tag),
               info={'seed': seed},
               upper_limit=u_limit,
               lower_limit=l_limit)


if __name__ == "__main__":
    p = parameters.Params()
    parallel_threads = p.threads
    seeds = [
        11, 59, 3, 6, 4, 18, 13, 1, 22, 34, 99, 43, 100, 15, 66, 10, 7, 9, 42,
        2
    ]

    # Selects seeds to run in parallel
    multiseeds = []
    for i in range(0, len(seeds), parallel_threads):
        multiseeds.append(seeds[i:min(i + parallel_threads, len(seeds))])

    total_train_time = 0

    for seeds in multiseeds:
        params = [parameters.Params()
 def load_params(self, path):
   print('Loading parameters...')
   self.params = parameters.Params()
   self.params.load(os.path.join(path, 'params.json'))
   assert self.env_tag == self.params.env_tag, 'Env tag from folder different from parameters env tag: {} - {}'.format(self.env_tag, self.params.env_tag)
  # print("")
  # for key in errors:
  #   avg = np.mean(errors[key])
  #   std = np.std(errors[key])
  #   print("Seed {}: Mean {} - Std {}.".format(key, avg, std))




  # Parameters
  # -----------------------------------------------
  seed = 42
  load_path = '/home/giuseppe/src/taxons/experiments/Maze_AE_Mixed/{}'.format(seed)

  params = parameters.Params()
  params.load(os.path.join(load_path, 'params.json'))

  env = gym.make(params.env_tag)
  # -----------------------------------------------

  # Possible targets
  # -----------------------------------------------
  # x = []
  # target_poses = []
  # if "Billiard" in params.env_tag:
  #   env.env.params.RANDOM_BALL_INIT_POSE = True
  # elif "Ant" in params.env_tag:
  #   env.render()
  #
  # for k in range(50): # Generate 50 target datapoints