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

add map-elites, with a brax ant example #33

Merged
merged 2 commits into from
May 25, 2022
Merged

add map-elites, with a brax ant example #33

merged 2 commits into from
May 25, 2022

Conversation

lerrytang
Copy link
Contributor

Add a simple implementation of the MAP-Elites algorithm (ref1, ref2), with an example on the Brax Ant task.
Users can implement their own behavior descriptor extractor, see an example in task/brax_task.py.

Example commands

python train_ant_map_elites.py --max-iter=3000
python train_ant_map_elites.py --max-iter=3000 --save-gif  # This can be slow

Example output

Note We plan to add more Quality Diversity methods, the implementations and related interfaces are subject to change.

@@ -49,3 +50,15 @@ def best_params(self) -> jnp.ndarray:
@best_params.setter
def best_params(self, params: Union[np.ndarray, jnp.ndarray]) -> None:
raise NotImplementedError()


class QualityDiversityMethod(NEAlgorithm, ABC):
Copy link
Collaborator

Choose a reason for hiding this comment

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

NEAlgorithm is already having ABC, so no need to put ABC here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!
done

@alantian
Copy link
Collaborator

LGTM!
Before merging, please have a look at the one minor issue (see the comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants