Image-to-Image
Transformers
Safetensors
patchsvae
image-reconstruction
svd
geometric-deep-learning
autoencoder
omega-tokens
geolip
custom_code
Instructions to use AbstractPhil/svae-fresnel-128 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AbstractPhil/svae-fresnel-128 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-to-image", model="AbstractPhil/svae-fresnel-128", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AbstractPhil/svae-fresnel-128", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| """PatchSVAE configuration for HuggingFace AutoModel.""" | |
| from transformers import PretrainedConfig | |
| class PatchSVAEConfig(PretrainedConfig): | |
| """Configuration for PatchSVAE — Fresnel geometric compression lens. | |
| Args: | |
| matrix_v: Number of rows per patch matrix (vocabulary size) | |
| D: Embedding dimension (number of singular values per patch) | |
| patch_size: Spatial patch size in pixels | |
| hidden: MLP hidden width for encoder/decoder | |
| depth: Number of residual blocks in encoder and decoder | |
| n_cross_layers: Number of spectral cross-attention layers | |
| max_alpha: Maximum coordination strength per spectral mode | |
| alpha_init: Initial alpha logit (sigmoid(alpha_init) * max_alpha) | |
| target_cv: Soft hand CV target for training | |
| image_size: Expected input image size (H=W) | |
| """ | |
| model_type = "patchsvae" | |
| def __init__( | |
| self, | |
| matrix_v=256, | |
| D=16, | |
| patch_size=16, | |
| hidden=768, | |
| depth=4, | |
| n_cross_layers=2, | |
| max_alpha=0.2, | |
| alpha_init=-2.0, | |
| target_cv=0.125, | |
| image_size=128, | |
| **kwargs, | |
| ): | |
| self.matrix_v = matrix_v | |
| self.D = D | |
| self.patch_size = patch_size | |
| self.hidden = hidden | |
| self.depth = depth | |
| self.n_cross_layers = n_cross_layers | |
| self.max_alpha = max_alpha | |
| self.alpha_init = alpha_init | |
| self.target_cv = target_cv | |
| self.image_size = image_size | |
| # Derived properties | |
| self.n_patches = (image_size // patch_size) ** 2 | |
| self.patch_dim = 3 * patch_size * patch_size | |
| self.mat_dim = matrix_v * D | |
| self.latent_channels = D | |
| self.latent_size = image_size // patch_size | |
| super().__init__(**kwargs) |