Skip to main content

Vision Transformer with Registers

Project description

A simple augmentation of PyTorch's VisionTransform class from torchvision.models to include registers, as per: https://arxiv.org/abs/2309.16588

Introduces registers to the encoder that are appended as tokens to the 'patchified' sequence, and excluded in the output.

The tokens are learnable parameters and do not receive positional embeddings.

The API of the class is identical with VisionTransformer, except the additional init argument for 'num_registers', which specifies the number of register tokens.

Installation


pip install rvit

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

rvit-1.0.3.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

rvit-1.0.3-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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