OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Mingru Pytorch

Mingru Pytorch is a Python implementation of the minGRU recurrent neural network architecture for PyTorch. It provides a log-space numerically stable version that accepts batched sequence tensors and supports both parallel processing and sequential token-by-token processing with hidden state carried between steps.

Independent OpenViST project profile, based on linked sources.

Mingru 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 a Python/PyTorch project needs the documented minGRU component, especially when the same sequence-processing workflow calls for both parallel input handling and sequential token-by-token inference.

Who it is for

  • PyTorch developers adding a recurrent sequence-processing component to a model.
  • Researchers and practitioners experimenting with minGRU-based sequence or language-model architectures.

Documented uses

  • Apply a minGRU layer to a batched sequence tensor.
  • Process a sequence in parallel or incrementally, carrying hidden state between tokens.
  • Use a minGRU implementation as a basis for sequence-model experiments.
Before you choose

Requirements & limits

The public repository identifies the project as open source under the MIT license.

  • The implementation is specifically the log-space numerically stable version.
  • The documented interface supports batched sequence tensors and a sequential mode that carries forward hidden state.
  • The repository provides a pip installation command and an enwik8 training entry point.

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 and apply the minGRU layer

Add the documented minGRU component to a Python sequence-model experiment and apply it to a batched input tensor.

Before you start

  • Python
  • PyTorch
  • Installation through pip

Steps

  1. Install the package with the command below.

    Documented command
    pip install minGRU-pytorch
  2. Import torch and minGRU from minGRU_pytorch.

  3. Create a layer with minGRU(512) and a tensor such as torch.randn(2, 1024, 512).

  4. Call the layer on the tensor to obtain the sequence output.

Expected outcome

A minGRU layer is applied to a batched sequence tensor; the README example shows output with the same shape as its input.

Guide limitations

  • The documented implementation is the log-space numerically stable version.
  • The example does not establish performance or compatibility beyond its stated use.
Source-based practical guide

Process a sequence sequentially with carried hidden state

Use the documented token-by-token interface and pass hidden state between sequence steps.

Before you start

  • Python
  • PyTorch
  • The installed minGRU-pytorch package
  • A sequence tensor with batch, sequence and feature dimensions

Steps

  1. Create a minGRU layer, as in the README example.

  2. Initialize the previous hidden state as None.

  3. Unbind the input sequence along its sequence dimension and call the layer for each token, passing the previous hidden state and setting return_next_prev_hidden=True.

  4. Retain the returned hidden state for the next token.

Expected outcome

Each token is processed in sequence while the hidden state is carried forward.

Guide limitations

  • The README's numerical comparison is a documented example, not an independent execution test.
  • The example compares final parallel and sequential outputs for a particular tensor and configuration.
Evidence and transparency

Sources & review

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