Comments (2)
This is not supported in Assistive Gym currently. It would require a few changes to do. First, the active human environments use an rllib interface, rather than a strict gym interface, see: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/envs/feeding_envs.py#L44
Then, for active human ends, there are actually two policies trained: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/learn.py#L34
You will want to pull out and use only the policy for the robot, and make sure to set coop=False when loading the policy: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/learn.py#L32
and ensure that self.human.controllable is False: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/envs/feeding.py#L13
from assistive-gym.
Thanks for the help. So I am trying to follow the steps you suggest. In order to pull out and only use the policy for the robot I did the following:
in learn.py
def setup_config(env, algo, coop=False, seed=0, extra_configs={}):
num_processes = multiprocessing.cpu_count()
if algo == 'ppo':
config = ppo.DEFAULT_CONFIG.copy()
config['train_batch_size'] = 19200
config['num_sgd_iter'] = 50
config['sgd_minibatch_size'] = 128
config['lambda'] = 0.95
config['model']['fcnet_hiddens'] = [100, 100]
elif algo == 'sac':
# NOTE: pip3 install tensorflow_probability
config = sac.DEFAULT_CONFIG.copy()
config['timesteps_per_iteration'] = 400
config['learning_starts'] = 1000
config['Q_model']['fcnet_hiddens'] = [100, 100]
config['policy_model']['fcnet_hiddens'] = [100, 100]
# config['normalize_actions'] = False
config['num_workers'] = num_processes
config['num_cpus_per_worker'] = 0
config['seed'] = seed
config['log_level'] = 'ERROR'
# if algo == 'sac':
# config['num_workers'] = 1
# HERE THE CHANGES
obs = env.reset()
config['observation_space'] = env.observation_space_robot
config['action_space'] = env.action_space_robot
# if coop:
# obs = env.reset()
# policies = {'robot': (None, env.observation_space_robot, env.action_space_robot, {}), 'human': (None, env.observation_space_human, env.action_space_human, {})}
# config['multiagent'] = {'policies': policies, 'policy_mapping_fn': lambda a: a}
# config['env_config'] = {'num_agents': 2}
return {**config, **extra_configs}
Is that how you pull out the policy for the robot only?
from assistive-gym.
Related Issues (20)
- Error with building custom bullet3 HOT 2
- Strange issue with training cooperative scratch environment HOT 3
- Reproducing Cooperative ItchScratch results HOT 2
- Issue with creating a new environment HOT 2
- Arm Manipulation Google Collaboratory HOT 3
- ValueError when using SAC with co-optimization HOT 1
- About p.setGravity HOT 1
- Issue Create New Environment HOT 1
- Transfer learned policy to actual robot
- Action space for FeedingSawyer HOT 3
- Import Custom 3D Objects HOT 2
- Can't load "human" environments HOT 1
- Hi, I can't train ppo on tutorial HOT 1
- Hi, i can't run the env_viewer.py HOT 2
- Add a new type of robot HOT 2
- ('Observation ({}) outside given space ({})!' Error when trying to train model HOT 4
- When I do "env = gym.make", I get an error "PicklingError: Could not pickle object as excessively deep recursion required. HOT 2
- Issue running Assistive_Gym_Basics.ipynb colab notebook HOT 2
- Unable to build Dockerfile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assistive-gym.