Skip to main content

Spline Based Transformer

Project description

Spline-Based Transformer (wip)

Implementation of the proposed Spline-Based Transformer 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.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

spline_based_transformer-0.0.5-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for spline_based_transformer-0.0.5.tar.gz
Algorithm Hash digest
SHA256 85345b6f6ee95c6d43cc599b830596b65f6f03d1301ac1121c9df0a8debda0d5
MD5 cf7571bd18cdd3d24b1413d9802fbd9d
BLAKE2b-256 96c0a83488f2162534ab8af3d68a3ebbcad746c058c962c708af6bea13c1fefe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spline_based_transformer-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b56cfcf661bdc7582ca66a4f3a866ca0f930d9b34b80a30aebfe3c2379d3cc40
MD5 077345da11fe9952d1b991e32ee7ee28
BLAKE2b-256 79897e9b4ed0dd3a11ebc86acb785463cca2be6f5f17fba06de2f8fdd97ce7fd

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