Skip to content

Commit 94bcff4

Browse files
author
Sasha
committed
Added config for goal reached reward
1 parent 2515ccf commit 94bcff4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

configs/flagrun.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"env": {
33
"name": "AntFlagrunBulletEnv-v0",
44
"max_steps": 1000,
5-
"ant_env_rew_weight": 1,
5+
"ant_env_rew_weight": 0,
66
"path_rew_weight": 1,
7+
"goal_reach_rew": 10,
78
"kwargs": {
89
"enclosed": true,
910
"timeout": 100,
@@ -40,10 +41,10 @@
4041
"use_pos": false
4142
},
4243
"general": {
43-
"name": "flagrun-10eps_100timeout_10size-env_and_path_rew",
44+
"name": "flagrun-pathrewfixedagain",
4445
"gens": 500,
4546
"policies_per_gen": 2400,
46-
"eps_per_policy": 10,
47+
"eps_per_policy": 20,
4748
"n_policies": 1,
4849
"batch_size": 500,
4950
"seed": null,

flagrun.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import gym
55
import numpy as np
66
# noinspection PyUnresolvedReferences
7-
import pybullet_envs
7+
import hrl_pybullet_envs
88
# noinspection PyUnresolvedReferences
9-
import pybulletgym
9+
import pybullet_envs
1010
import torch
1111
from mpi4py import MPI
1212
from torch import Tensor, clamp, cat, nn
@@ -162,6 +162,7 @@ def run_model(model: PrimFF,
162162
env: gym.Env = gym.make(cfg.env.name, enclosed=True, timeout=-1)
163163
env.ant_env_rew_weight = cfg.env.ant_env_rew_weight
164164
env.path_rew_weight = cfg.env.path_rew_weight
165+
env.goal_reach_rew = cfg.env.goal_reach_rew
165166
# seeding; this must be done before creating the neural network so that params are deterministic across processes
166167
rs, my_seed, global_seed = utils.seed(comm, cfg.general.seed, env)
167168
all_seeds = comm.alltoall([my_seed] * comm.size) # simply for saving/viewing the seeds used on each proc

0 commit comments

Comments
 (0)