Skip to main content

Reformer

a Pytorch implementation of the Reformer Network (https://openreview.net/pdf?id=rkgNKkHtvB)

Much of this code base is loosely translated from the jax implementation found here from Google: https://github.com/google/trax/blob/master/trax/models/research/reformer.py

How to use

All of the hard work has been taken care of, all you need to do is instantiate the model!

from reformer_lm.reformer_lm import ReformerLM
import torch

test = torch.rand((4, 4, 64))
model = ReformerLM(
    vocab_size=300000,
    d_in=test.shape[-2],
    d_out=test.shape[-1],
    n_layers=6,
    n_heads=1,
    attn_k=test.shape[-1],
    attn_v=test.shape[-1],
)

output = model(test)
print(output)

This model is still in testing, and will therefore continue to see updates. PRs are welcomed! Feel free to take advantage of the Docker container for development. I have been working in notebooks to test code with the original paper, and then I refactor my code back into the package

paypal

Metadata

Release files for reformer-lm 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reformer-lm 1.0.1
File Size Uploaded Provenance
reformer_lm-1.0.1.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for reformer-lm 1.0.1
File Interpreter ABI Platform
reformer_lm-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / reformer_lm-1.0.1.tar.gz

Download URL reformer_lm-1.0.1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e607623fc53b06d2ad459c467a63fa2708e5e0e05aa7909adf309a6347820f37
BLAKE2b-256 checksum
How to use checksums
2928557c9269d29bd780fbda91e46d39ae03ab30b38c8be2f8f9610a278b8255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

Release files / reformer_lm-1.0.1-py3-none-any.whl

Download URL reformer_lm-1.0.1-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cae226bb9eb07e74dbf8b643b595fadf6bf6166f727f4fc46f1d4929892bb90
BLAKE2b-256 checksum
How to use checksums
7ad375ecb2cf438a06bd8031dd427427e46f6229df37b262fe9dbdcf6bff454c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

Security for reformer-lm 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page