adaptive-intelligent-robotics / QDax

Accelerated Quality-Diversity
https://qdax.readthedocs.io/en/latest/
MIT License
266 stars 45 forks source link

Add MapElites distributed on multiple devices #117

Closed felixchalumeau closed 1 year ago

felixchalumeau commented 1 year ago

Related to #65

We introduce a new class DistributedMAPElites that inherits from MAPElites. Only the instantiation method can be inherited, the init and update functions need to be written again because MAPElites class has not been designed to be multi-device and it is not the primary objective of QDax. Nevertheless, we think this example will help people understand how to create their own distributed algorithm with QDax if needed.

This PR also introduce a method for MAPElitesRepertoire, to resolve #106

codecov-commenter commented 1 year ago

Codecov Report

Merging #117 (8f3a8e5) into develop (a5c19a2) will increase coverage by 0.56%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #117      +/-   ##
===========================================
+ Coverage    91.74%   92.30%   +0.56%     
===========================================
  Files           97      103       +6     
  Lines         5403     5810     +407     
===========================================
+ Hits          4957     5363     +406     
- Misses         446      447       +1     
Impacted Files Coverage Δ
qdax/core/containers/mapelites_repertoire.py 85.41% <100.00%> (+0.63%) :arrow_up:
qdax/core/emitters/omg_mega_emitter.py 97.87% <100.00%> (-0.09%) :arrow_down:
qdax/core/emitters/qdpg_emitter.py 100.00% <0.00%> (ø)
tests/baselines_test/qdpg_test.py 100.00% <0.00%> (ø)
qdax/core/containers/archive.py 97.36% <0.00%> (ø)
qdax/core/emitters/dpg_emitter.py 100.00% <0.00%> (ø)
tests/core_test/containers_test/archive_test.py 100.00% <0.00%> (ø)
qdax/core/emitters/qpg_emitter.py 100.00% <0.00%> (ø)
qdax/core/emitters/multi_emitter.py 96.72% <0.00%> (+0.16%) :arrow_up:
qdax/core/emitters/pga_me_emitter.py 100.00% <0.00%> (+0.71%) :arrow_up:
... and 1 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more