algorithm
algorithm
¶
Action-decoding algorithm configurations.
DecodingAlgorithmConfig
dataclass
¶
Base algorithm configuration.
Note: For variational algorithms, use VariationalAlgorithmConfig instead of setting latent_encoder on individual algorithms.
Attributes:
| Name | Type | Description |
|---|---|---|
_target_ |
str
|
Import path instantiated by Hydra. |
BehavioralCloningConfig
dataclass
¶
BehavioralCloningConfig(_target_='versatil.models.decoding.algorithm.behavior_cloning.BehavioralCloning')
Bases: DecodingAlgorithmConfig
Behavioral Cloning (direct supervised prediction) algorithm configuration.
This is a pure, deterministic algorithm. For multi-modal action prediction, use VariationalAlgorithmConfig with BehavioralCloningConfig as the base_algorithm.
DiffusionConfig
dataclass
¶
DiffusionConfig(_target_='versatil.models.decoding.algorithm.diffusion.Diffusion', scheduler_type=value, num_train_timesteps=100, num_inference_steps=10, beta_start=0.0001, beta_end=0.02, beta_schedule=value, prediction_type=value, scheduler_variance_type=value, clip_sample=True, set_alpha_to_one=True, steps_offset=0)
Bases: DecodingAlgorithmConfig
Diffusion algorithm configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
_target_ |
str
|
Import path instantiated by Hydra. |
scheduler_type |
str
|
Type of diffusion scheduler ("ddpm" or "ddim"). |
num_train_timesteps |
int
|
Number of diffusion steps during training. |
num_inference_steps |
int
|
Number of denoising steps during inference. |
beta_start |
float
|
Starting value of noise schedule. |
beta_end |
float
|
Ending value of noise schedule. |
beta_schedule |
str
|
Noise schedule type ("linear", "squaredcos_cap_v2", etc.). |
prediction_type |
str
|
What the network predicts ("epsilon" for noise, "sample" for clean actions). |
scheduler_variance_type |
str
|
Variance type for DDPM scheduler. |
clip_sample |
bool
|
Whether to clip samples to [-1, 1] during inference. |
set_alpha_to_one |
bool
|
Whether to set final alpha to 1. |
steps_offset |
int
|
Offset for timestep calculation. |
FlowMatchingConfig
dataclass
¶
FlowMatchingConfig(_target_='versatil.models.decoding.algorithm.flow_matching.FlowMatching', sigma=0.0, ode_solver=value, num_inference_steps=10, timestep_sampler=BETA.value, logit_mean=0.0, logit_std=1.0, beta_alpha=1.5, beta_beta=1.0, max_timestep=0.999, reverse_flow_convention=False)
Bases: DecodingAlgorithmConfig
Flow Matching algorithm configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
_target_ |
str
|
Import path instantiated by Hydra. |
sigma |
float
|
Noise level for conditional flow matching (0 = deterministic OT). |
ode_solver |
str
|
ODE solver to use ("euler", "heun", or "rk4"). |
num_inference_steps |
int
|
Number of integration steps during inference. |
timestep_sampler |
str
|
Timestep sampling strategy. |
logit_mean |
float
|
Mean for logit-normal (shifts mode; 0 centers at t=0.5). |
logit_std |
float
|
Std for logit-normal (smaller = more concentrated). |
beta_alpha |
float
|
First shape parameter for Beta distribution (pi0 uses 1.5). |
beta_beta |
float
|
Second shape parameter for Beta distribution (pi0 uses 1.0). |
max_timestep |
float
|
Upper bound s for Beta sampling (pi0 uses 0.999). |
reverse_flow_convention |
bool
|
Reverse the time/velocity convention during inference. When True, the inference loop remaps t to (1-t) and negates the predicted velocity. |
VariationalAlgorithmConfig
dataclass
¶
VariationalAlgorithmConfig(_target_='versatil.models.decoding.algorithm.variational.VariationalAlgorithm', base_algorithm=MISSING, posterior_encoder=MISSING, prior=MISSING, sampling_from_prior_probability=0.25, posterior_decoder_noise_std=0.0)
Bases: DecodingAlgorithmConfig
Compositional variational inference wrapper configuration.
Wraps any base algorithm with variational latent encoding for multi-modal action prediction. This replaces the need for algorithm-specific variational implementations.
Examples:
Behavioral Cloning with VAE + Gaussian prior¶
VariationalAlgorithmConfig( base_algorithm=BehavioralCloningConfig(), posterior_encoder=VAETransformerEncoderConfig(...), prior=None # Auto-creates GaussianPrior )
Flow Matching with VAE + Diffusion prior (replaces VariationalFlowMatching)¶
VariationalAlgorithmConfig( base_algorithm=FlowMatchingConfig(sigma=0.0, num_inference_steps=10), posterior_encoder=VAETransformerEncoderConfig(...), prior=DiTPriorConfig(...) )
NEW: Diffusion with VAE + learned prior¶
VariationalAlgorithmConfig( base_algorithm=DiffusionConfig(...), posterior_encoder=VAETransformerEncoderConfig(...), prior=DiTPriorConfig(...) )
Attributes:
| Name | Type | Description |
|---|---|---|
_target_ |
str
|
Import path instantiated by Hydra. |
base_algorithm |
DecodingAlgorithmConfig
|
The base decoding algorithm (BC, FlowMatching, Diffusion, etc.) |
posterior_encoder |
PosteriorLatentEncoderConfig
|
Latent encoder for posterior q(z|a,s) (typically VAE) |
prior |
PriorLatentEncoderConfig
|
Latent prior for p(z|s). If None, auto-creates GaussianPrior. |