generators
generators
¶
Trajectory generators for synthetic multimodal benchmark tasks.
Each task produces episodes with controlled multimodality in [0, 1]x[0, 1] Cartesian space. Actions are fixed delta positions: action[t] = position[t+1] - position[t].
generate_task_episodes
¶
generate_task_episodes(task_name=value, num_episodes=DEFAULT_NUM_EPISODES, seed=DEFAULT_SEED, image_size=DEFAULT_IMAGE_SIZE, num_modes=MULTIPATH_DEFAULT_NUM_MODES, trajectory_length=MULTIPATH_DEFAULT_TRAJECTORY_LENGTH, noise_std=MULTIPATH_DEFAULT_NOISE_STD, num_styles=CORRIDOR_DEFAULT_NUM_STYLES, mode_weights=None)
Generate synthetic episodes for a given task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_name
|
str
|
SyntheticTaskName.value string identifying which multimodal navigation task to generate. |
value
|
num_episodes
|
int
|
Total number of episodes to generate, balanced equally across all behavioral modes. |
DEFAULT_NUM_EPISODES
|
seed
|
int
|
Random seed for reproducible generation. |
DEFAULT_SEED
|
image_size
|
int
|
Side length in pixels of the rendered top-down RGB images (square). |
DEFAULT_IMAGE_SIZE
|
num_modes
|
int
|
Number of distinct behavioral modes for tasks that accept a variable mode count (radial, corridor_navigation). |
MULTIPATH_DEFAULT_NUM_MODES
|
trajectory_length
|
int
|
Number of timesteps per episode. |
MULTIPATH_DEFAULT_TRAJECTORY_LENGTH
|
noise_std
|
float
|
Standard deviation of Gaussian noise added to trajectory positions for intra-mode variance. |
MULTIPATH_DEFAULT_NOISE_STD
|
num_styles
|
int
|
Number of sinusoidal trajectory styles per corridor (corridor_navigation task only). |
CORRIDOR_DEFAULT_NUM_STYLES
|
mode_weights
|
list[float] | None
|
Relative weights per mode for imbalanced generation. None for uniform distribution across modes. |
None
|
Returns:
| Type | Description |
|---|---|
list[dict[str, ndarray]]
|
List of episode dicts. Each dict contains: "image": rendered top-down RGB, shape (T, image_size, image_size, 3), uint8 "position": Cartesian (x, y) states, shape (T, 2), float32 "action": delta (dx, dy) commands, shape (T, 2), float32 "mode_id": ground-truth mode label, shape (T, 1), uint8 "context": conditioning context vector, shape (T, C), float32 |
Source code in src/versatil/data/synthetic/generators.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |