in lerobot/common/policies/vqbet/vqbet_utils.py [0:0]
def __init__(
self,
dim,
codebook_size,
codebook_dim=None,
heads=1,
separate_codebook_per_head=False,
decay=0.8,
eps=1e-5,
kmeans_init=False,
kmeans_iters=10,
sync_kmeans=True,
threshold_ema_dead_code=0,
channel_last=True,
accept_image_fmap=False,
commitment_weight=1.0,
commitment_use_cross_entropy_loss=False,
orthogonal_reg_weight=0.0,
orthogonal_reg_active_codes_only=False,
orthogonal_reg_max_codes=None,
stochastic_sample_codes=False,
sample_codebook_temp=1.0,
straight_through=False,
reinmax=False, # using reinmax for improved straight-through, assuming straight through helps at all
sync_codebook=None,
sync_affine_param=False,
ema_update=True,
learnable_codebook=False,
in_place_codebook_optimizer: Callable[
..., Optimizer
] = None, # Optimizer used to update the codebook embedding if using learnable_codebook
affine_param=False,
affine_param_batch_decay=0.99,
affine_param_codebook_decay=0.9,
sync_update_v=0.0, # the v that controls optimistic vs pessimistic update for synchronous update rule (21) https://minyoungg.github.io/vqtorch/assets/draft_050523.pdf