synthetic_rollout
synthetic_rollout
¶
Callback for evaluating synthetic benchmark policies during training.
SyntheticRolloutCallback
¶
SyntheticRolloutCallback(task_name, num_modes, num_styles, trajectory_length, noise_std, num_rollouts=50, image_size=64, log_every_n_epochs=1)
Bases: Callback
Run rollouts and log mode coverage metrics at the end of each training epoch.
Puts the policy in eval mode, generates trajectories via closed-loop rollout, computes mode coverage and goal success against regenerated expert demonstrations, and logs metrics + trajectory plots to wandb.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_name
|
str
|
SyntheticTaskName.value string. |
required |
num_modes
|
int
|
Number of behavioral modes to generate for expert reference. Must match the training dataset. |
required |
num_styles
|
int
|
Number of sinusoidal styles per corridor gap. Ignored by tasks that do not use styles. |
required |
trajectory_length
|
int
|
Length of generated expert and rollout trajectories. |
required |
noise_std
|
float
|
Standard deviation of expert trajectory noise. |
required |
num_rollouts
|
int
|
Number of rollout trajectories per evaluation. |
50
|
image_size
|
int
|
Side length for rendered observation images. |
64
|
log_every_n_epochs
|
int
|
Evaluate every N epochs. |
1
|
Initialize rollout generation and logging parameters.
Source code in src/versatil/training/callbacks/synthetic_rollout.py
on_train_epoch_end
¶
Run rollouts, compute metrics, log to wandb and console.
Source code in src/versatil/training/callbacks/synthetic_rollout.py
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |