OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Enformer Pytorch

Enformer Pytorch is a Python and PyTorch implementation of Enformer for predicting gene-expression signals from DNA sequences and fine-tuning pretrained genomic representations for downstream tasks.

Independent OpenViST project profile, based on linked sources.

Enformer Pytorch — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need a self-hosted PyTorch implementation of Enformer and want direct control over sequence inputs, model outputs, embeddings, or downstream fine-tuning.

Who it is for

  • Computational genomics researchers
  • Machine-learning developers working with DNA sequences
  • Teams building self-hosted gene-expression or regulatory-genomics workflows

Documented uses

  • Predict gene-expression outputs from encoded DNA sequences.
  • Extract embeddings for downstream genomic analysis.
  • Fine-tune pretrained representations for new genomic tracks.
  • Adapt the model to contextual or chromatin-accessibility prediction tasks.
Before you choose

Requirements & limits

The repository is public and specifies an MIT license. Installation is documented through pip; no hosted service account or subscription requirement is identified.

  • It uses PyTorch and Python rather than the original TensorFlow/Sonnet implementation.
  • The repository documents both direct prediction and fine-tuning interfaces.
  • Inputs can be supplied as nucleotide indices or one-hot encodings.
  • Pretrained weights are loaded through the documented Hugging Face model identifier.
  • Fine-tuning requires suitable genomic targets and can involve substantial local compute; the examples use CUDA.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install the Enformer Pytorch package

Set up the Python package so a PyTorch Enformer model can be instantiated for genomic sequence analysis.

Before you start

  • Python environment with pip
  • PyTorch
  • A supported local operating system: Linux, Windows, or macOS

Steps

  1. Install the package with the command below.

    Documented command
    pip install enformer-pytorch
  2. Import Enformer from enformer_pytorch and instantiate it with the documented hyperparameters, output heads, and target length.

  3. Prepare a DNA sequence as nucleotide indices in ACGTN order, using -1 for padding, or convert sequence indices to one-hot encodings.

  4. Pass the encoded sequence to the model to obtain the documented human and mouse output heads.

Expected outcome

A locally instantiated PyTorch Enformer model can receive encoded DNA sequences and return prediction tensors for its configured output heads.

Guide limitations

  • The example documents model invocation and outputs but does not establish performance on a user's data.
  • The example configuration uses a 196,608-position sequence and specific human and mouse heads; other configurations require appropriate model and data choices.
  • This is source-based setup guidance, not a compatibility or execution test.
Source-based practical guide

Fine-tune pretrained Enformer weights for new genomic tracks

Configure the documented head-adapter workflow for adapting pretrained Enformer representations to task-specific genomic tracks.

Before you start

  • The enformer-pytorch package
  • Access to the pretrained model identifier EleutherAI/enformer-official-rough through the documented loader
  • PyTorch tensors containing DNA sequences and task targets
  • CUDA-capable execution is shown in the repository examples for the training workflow

Steps

  1. Load the pretrained model with from_pretrained('EleutherAI/enformer-official-rough').

  2. Wrap it with HeadAdapterWrapper, specifying the number of target tracks and the documented embedding-position option if needed.

  3. Prepare encoded DNA sequences and target tensors with matching task dimensions.

  4. Pass the sequence and target to the wrapper, calculate the returned loss, and call loss.backward() as shown.

Expected outcome

A pretrained Enformer model is configured with an adapter for downstream genomic-track training.

Guide limitations

  • The repository example shows the training path but does not provide a complete training loop, optimizer configuration, dataset, or finished model.
  • The documented example uses CUDA and task-specific tensor dimensions; actual resource and shape requirements depend on the chosen data.
  • This is source-based guidance, not a training result or audit.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
4 October 2026
Original website title
lucidrains/enformer-pytorch · Official homepage title · retained in its source language