Skip to content

Commit

Permalink
Fix omg_mega emitter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxencefaldor committed Jan 8, 2024
1 parent 84a8f97 commit 9e75ded
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions qdax/core/emitters/omg_mega_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ def init(
genotype=gradient_genotype, centroids=self._centroids
)

# get gradients out of the extra scores
assert "gradients" in extra_scores.keys(), "Missing gradients or wrong key"
gradients = extra_scores["gradients"]

# update the gradients repertoire
gradients_repertoire = gradients_repertoire.add(
gradients,
descriptors,
fitnesses,
extra_scores,
)

return (
OMGMEGAEmitterState(gradients_repertoire=gradients_repertoire),
random_key,
Expand Down

0 comments on commit 9e75ded

Please sign in to comment.