Closed manon-but-yes closed 1 year ago
Merging #109 (f9f4d3e) into develop (46e82b6) will increase coverage by
0.10%
. The diff coverage is75.00%
.
@@ Coverage Diff @@
## develop #109 +/- ##
===========================================
+ Coverage 90.69% 90.80% +0.10%
===========================================
Files 84 84
Lines 4677 4677
===========================================
+ Hits 4242 4247 +5
+ Misses 435 430 -5
Impacted Files | Coverage Δ | |
---|---|---|
tests/default_tasks_test/brax_task_test.py | 97.14% <ø> (ø) |
|
qdax/tasks/brax_envs.py | 96.66% <75.00%> (+8.33%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
This PR aims to fix the way the reset_based scoring function is used in the
create_default_brax_task_components
function, which allows the creation of a default Brax environment.The reset_based scoring function takes as input a reset function
play_reset_fn
and thus allows to define either deterministic or stochastic tasks. However, it has a second advantage compared to the usual scoring function: as it vmap theplay_reset_fn
, it works with any dimension of genotype to evaluate. Unlike the default scoring function that can only evaluate a fixed number of genotypes (of the same size as the init_states given as input).The current
create_default_brax_task_components
takes as input a booleanis_reset_based
and depending on it returns either the default scoring function or the reset_based scoring function. This commit uniformises this with the following changes:is_reset_based
boolean, use adeterministic
boolean (True
by default) to set up either a deterministic or stochastic environment.