Spline Based Transformer
Project description
Spline-Based Transformer (wip)
Implementation of the proposed Spline-Based Transformer (paper) from Disney Research
This is basically a transformer based autoencoder, but they cleverly use a set of latent tokens, where that set of tokens are the (high dimensional) control points for a spline.
Install
$ pip install spline-based-transformer
Usage
import torch
from spline_based_transformer import SplineBasedTransformer
model = SplineBasedTransformer(
dim = 512,
enc_depth = 6,
dec_depth = 6
)
data = torch.randn(1, 1024, 512)
loss = model(data, return_loss = True)
loss.backward()
# after much training
recon, control_points = model(data, return_latents = True)
assert data.shape == recon.shape
# mess with the control points, which should preserve continuity better
control_points += 1
controlled_recon = model.decode_from_latents(control_points, num_times = 1024)
assert controlled_recon.shape == data.shape
Citations
@misc{Chandran2024,
author = {Prashanth Chandran, Agon Serifi, Markus Gross, Moritz Bächer},
url = {https://la.disneyresearch.com/publication/spline-based-transformers/}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spline_based_transformer-0.0.7.tar.gz
.
File metadata
- Download URL: spline_based_transformer-0.0.7.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4217724e36004e225dbc39db4f7b805a47a89bb7c60c9a0bb7a237667f506e02 |
|
MD5 | a960155fbc159f261373d7347fe52dc2 |
|
BLAKE2b-256 | abad4b174131a71b5b7a8e102321092fd2e3d9ca2f461128d4646eb6970e74f7 |
File details
Details for the file spline_based_transformer-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: spline_based_transformer-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2fb0ed27eaf297065c82b42fc33e5cdeb3f6ab7aaadc77da21a9519bb843414 |
|
MD5 | 06eea7c8eaf056d99dc43e551bb32158 |
|
BLAKE2b-256 | b383a630151d218808dad387ba8311d1830bad25699f7ddaef90e0cd1081e83a |