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.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

spline_based_transformer-0.0.4-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for spline_based_transformer-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a59d88f3dda67a550c49de07f25c288697fafe567048413c89470c3ab139ddfb
MD5 8f8a1267e30393ee2d1992851edeb90d
BLAKE2b-256 a050a6400bc7b85f7ac1e57696307e2b5c83a5e47fb1518ec8564acb6733977a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spline_based_transformer-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3f22c8c826290445a2b143f6e457a9a3d265b73715769cadf3aa62ded2c4f85
MD5 637d9003d4337363a8da93b987601ee8
BLAKE2b-256 4a8dca56842bec45484967870e8dd9da499e1529047540e838c06e2b67f82804

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