| # tactile_vae | |
| ViT-based tactile variational autoencoder. | |
| ## Architecture | |
| - Encoder: `PatchEmbed + Transformer blocks + fixed sin-cos positional embedding` | |
| - Latent: `mu/logvar` + reparameterization | |
| - Decoder: latent-conditioned transformer patch decoder + unpatchify | |
| ## Usage | |
| ```python | |
| import torch | |
| from tactile_vae.model import TactileVAE, VAELoss | |
| model = TactileVAE() | |
| out = model(torch.randn(2, 3, 128, 128)) | |
| loss_fn = VAELoss(beta=1.0) | |
| losses = loss_fn(out["x_hat"], torch.randn(2, 3, 128, 128), out["mu"], out["logvar"]) | |
| ``` | |