Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hab3_merge] Define different policies for different agents #1530

Merged
merged 9 commits into from
Aug 24, 2023

Conversation

xavierpuigf
Copy link
Contributor

Motivation and Context

This is needed so that we can define different policy types for each agent. It may be useful to be able to train a multi-agent task where one agent is run by a planner and the other one is run by a neural net, or one has a low level policy and the other has a high level policy.

Cherry-picked from this PR: 26a9696

How Has This Been Tested

Passes Test + End to End Testing.

Types of changes

  • [Development] A pull request that add new features to the habitat-lab task and environment codebase. Development Pull Requests must be small (less that 500 lines of code change), have unit testing, very extensive documentation and examples. These are typically new tasks, environments, sensors, etc... The review process for these Pull Request is longer because these changes will be maintained by our core team of developers, so make sure your changes are easy to understand!

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 23, 2023
@xavierpuigf xavierpuigf requested a review from akshararai August 23, 2023 18:37
@xavierpuigf
Copy link
Contributor Author

I'm blocked on some of the CI Tests. I don't know how to address this one for instance:

python -m pytest test/test_baseline_trainers.py::test_ver_trainer[True-True-test/config/habitat_baselines/ddppo_pointnav_test.yaml]

@rpartsey Could you check if I am missing/misunderstanding something in Hydra?

obs_trans_conf = config.habitat_baselines.rl.policy.obs_transforms
if hasattr(config.habitat_baselines.rl.policy, "obs_transforms"):

# We assume for now that the observation space is shared among agents
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't assume this in general right? Only when using observation transformations?

).articulated_agent.get_joint_transform()[0]
return np.array(joints_pos, dtype=np.float32)
curr_agent = self._sim.get_agent_data(self.agent_id).articulated_agent
if hasattr(curr_agent, "get_joint_transform"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check for the type with is instance instead of hasattr? This will be more clear what interface you expect here.

@xavierpuigf xavierpuigf merged commit f84e8bd into main Aug 24, 2023
@xavierpuigf xavierpuigf deleted the main_different_policies_per_agent branch August 24, 2023 15:38
@xavierpuigf xavierpuigf restored the main_different_policies_per_agent branch August 24, 2023 16:50
xavierpuigf added a commit that referenced this pull request Aug 24, 2023
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
…research#1530)

* define policies per agent

* fix

* udpate configs to support multiagent

* change configs to support agent name in polic

* solving more pytest

* correcting test

* pytest solve

* correct pytets

* small comment update
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
HHYHRHY pushed a commit to SgtVincent/EMOS that referenced this pull request Aug 31, 2024
…research#1530)

* define policies per agent

* fix

* udpate configs to support multiagent

* change configs to support agent name in polic

* solving more pytest

* correcting test

* pytest solve

* correct pytets

* small comment update
HHYHRHY pushed a commit to SgtVincent/EMOS that referenced this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants