Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spline_based_transformer-0.0.9.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

spline_based_transformer-0.0.9-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file spline_based_transformer-0.0.9.tar.gz.

File metadata

File hashes

Hashes for spline_based_transformer-0.0.9.tar.gz
Algorithm Hash digest
SHA256 6f5dc2a64ac1f050fcfa824185d69f0f7554e8cf5ccd8eaeaaa12bf1aa291594
MD5 959689f3f841dd078ec317c99aca13c8
BLAKE2b-256 9527e2c571e1f151628a0fe96d930b243686d8005d7432ca10b62c4e96e75e69

See more details on using hashes here.

File details

Details for the file spline_based_transformer-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for spline_based_transformer-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7d19bbfd1fa4fa0c7fd8119a2688008a63269a974bbd945ed82804a12aabbee6
MD5 1833c96006aca4d9736908a10b697b71
BLAKE2b-256 7033e473ae8e7a9c17661dbd2cc436176d89562ed85959b0902ba1523e5eb9d7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page