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.10.tar.gz
.
File metadata
- Download URL: spline_based_transformer-0.0.10.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94976018b6734523ffe99824bc7e737fe3ff748bba60af0ea3b15784a4b9c3a9 |
|
MD5 | 9a2ce9f99da8265035fefc7321124df9 |
|
BLAKE2b-256 | 152125f3a8e0b9cc45069bb40349048244ab6a7b678461444d4d09c0634183a3 |
File details
Details for the file spline_based_transformer-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: spline_based_transformer-0.0.10-py3-none-any.whl
- Upload date:
- Size: 6.1 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 | cff6e6204ae215c76cc87b9f56241b93edf1f3838833c79743457b0e1e72e32a |
|
MD5 | 40af94352e07492074e95b8329f00414 |
|
BLAKE2b-256 | d0ed13b60d8bfd4adf9d59da7d252eb660a45896432528e3802f0bf175e20b1a |