The tasks
directory provides default scoring_function
's to import easily to perform experiments without the boilerplate code so that the main script is kept simple and is not bloated. It provides a set of fixed tasks that is not meant to be modified. If you are developing and require the flexibility of modifying the task and the details that come along with it, we recommend copying and writing your own custom scoring_function
in your main script instead of importing from tasks
.
The tasks
directory also serves as a way to maintain a QD benchmark task suite that can be easily accesed. We implement several benchmark task across a range of domains. The tasks here are classical tasks from QD literature as well as more recent benchmarks tasks proposed at the QD Benchmarks Workshop at GECCO 2022.
Task | Parameter Dimensions | Parameter Bounds | Descriptor Dimensions | Descriptor Bounds | Description |
---|---|---|---|---|---|
Arm | n | 2 | |||
Noisy Arm | n | 2 |
Notes:
- the parameter space is normalized between
$[0,1]$ which corresponds to$[0,2\pi]$ - the descriptor space (end-effector x-y position) is normalized between
$[0,1]$
import jax
from qdax.tasks.arm import arm_scoring_function
random_key = jax.random.PRNGKey(0)
# Get scoring function
scoring_fn = arm_scoring_function
# Get Task Properties (parameter space, descriptor space, etc.)
min_param, max_param = 0., 1.
min_desc, max_desc = 0., 1.
# Get initial batch of parameters
num_param_dimensions = ...
init_batch_size = ...
random_key, _subkey = jax.random.split(random_key)
initial_params = jax.random.uniform(
_subkey,
shape=(init_batch_size, num_param_dimensions),
minval=min_param,
maxval=max_param,
)
# Get number of descriptor dimensions
desc_size = 2
Task | Parameter Dimensions | Parameter Bounds | Descriptor Dimensions | Descriptor Bounds | Description |
---|---|---|---|---|---|
Sphere | n | 2 | |||
Rastrigin | n | 2 | |||
Rastrigin-Projection | n | 2 |
import jax
from qdax.tasks.standard_functions import sphere_scoring_function
random_key = jax.random.PRNGKey(0)
# Get scoring function
scoring_fn = sphere_scoring_function
# Get Task Properties (parameter space, descriptor space, etc.)
min_param, max_param = 0., 1.
min_desc, max_desc = 0., 1.
# Get initial batch of parameters
num_param_dimensions = ...
init_batch_size = ...
random_key, _subkey = jax.random.split(random_key)
initial_params = jax.random.uniform(
_subkey,
shape=(init_batch_size, num_param_dimensions),
minval=min_param,
maxval=max_param,
)
# Get number of descriptor dimensions
desc_size = 2
"Hypervolume-based Benchmark Functions for Quality Diversity Algorithms" by Jean-Baptiste Mouret
Task | Parameter Dimensions | Parameter Bounds | Descriptor Dimensions | Descriptor Bounds | Description |
---|---|---|---|---|---|
Square | n | n | |||
Checkered | n | n | |||
Empty Circle | n | n | |||
Non-continous Islands | n | n | |||
Continous Islands | n | n |
import jax
from qdax.tasks.hypervolume_functions import square_scoring_function
random_key = jax.random.PRNGKey(0)
# Get scoring function
scoring_fn = square_scoring_function
# Get Task Properties (parameter space, descriptor space, etc.)
min_param, max_param = 0., 1.
min_desc, max_desc = 0., 1.
# Get initial batch of parameters
num_param_dimensions = ...
init_batch_size = ...
random_key, _subkey = jax.random.split(random_key)
initial_params = jax.random.uniform(
_subkey,
shape=(init_batch_size, num_param_dimensions),
minval=min_param,
maxval=max_param,
)
# Get number of descriptor dimensions
desc_size = num_param_dimensions
"Towards QD-suite: developing a set of benchmarks for Quality-Diversity algorithms" by Achkan Salehi and Stephane Doncieux
Task | Parameter Dimensions | Parameter Bounds | Descriptor Dimensions | Descriptor Bounds | Description |
---|---|---|---|---|---|
archimedean-spiral-v0 | 1 |
|
1 (geodesic BD) 2 (euclidean BD) |
|
|
SSF-v0 | Unbounded | 1 |
|
||
deceptive-evolvability-v0 |
|
Bounded area including the two gaussian peaks | 1 |
import math
from qdax.tasks.qd_suite import archimedean_spiral_v0_angle_euclidean_task
task = archimedean_spiral_v0_angle_euclidean_task
# Get scoring function
scoring_fn = task.scoring_function
# Get Task Properties (parameter space, descriptor space, etc.)
min_param, max_param = task.get_min_max_params()
min_desc, max_desc = task.get_bounded_min_max_descriptor() # To consider bounded Descriptor space
# If the task has a descriptor space that is not bounded, then the unbounded descriptor
# space can be obtained via the following:
# min_bd, max_bd = task.get_min_max_bd()
# Get initial batch of parameters
initial_params = task.get_initial_parameters(batch_size=...)
# Get number of descriptor dimensions
desc_size = task.get_descriptor_size()
Task | Parameter Dimensions | Parameter Bounds | Descriptor Dimensions | Descriptor Bounds | Description |
---|---|---|---|---|---|
pointmaze | NN params | Unbounded | 2 | ||
hopper_uni | NN params | Unbounded | 1 | ||
walker2d_uni | NN params | Unbounded | 2 | ||
halfcheetah_uni | NN params | Unbounded | 2 | ||
ant_uni | NN params | Unbounded | 4 | ||
humanoid_uni | NN params | Unbounded | 2 | ||
ant_omni | NN params | Unbounded | 2 | ||
humanoid_omni | NN params | Unbounded | 2 | ||
anttrap | NN params | Unbounded | 2 | ||
antmaze | NN params | Unbounded | 2 |
Notes:
- the parameter dimensions for default Brax-RL tasks depend on the size and architecture of the neural network used and can be customized and changed easily. If not set, a network size of two hidden layers of size 64 is used.
QDax provide utils to interact easily with the suite of environments implemented in Jumanji.