Skip to main content

A PyTorch implementation of Fast ULCNet

Project description

fast-ulcnet-torch

Implements FastULCNet and Comfi-FastGRNN in torch.

Usage

The ComfiFastGRNN module is designed to be a drop-in replacement for standard PyTorch RNN layers (like nn.LSTM or nn.GRU), but with added support for low-rank factorization and complementary filtering.

Basic Implementation

Here is how to use the layer with default settings in a standard training loop:

import torch
from comfi_fast_grnn_torch import ComfiFastGRNN 

# 1. Initialize the layer
# batch_first=True is the default for this implementation
model = ComfiFastGRNN(
    input_size=32, 
    hidden_size=64, 
    num_layers=1
)

# 2. Create dummy input: (Batch Size, Sequence Length, Input Size)
x = torch.randn(10, 50, 32)

# 3. Forward pass
# Returns output (all timesteps) and final hidden state
output, h_n = model(x)

print(f"Output shape: {output.shape}")  # torch.Size([10, 50, 64])
print(f"Hidden state shape: {h_n.shape}") # torch.Size([1, 10, 64])

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

comfi_fast_grnn_torch-0.0.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

comfi_fast_grnn_torch-0.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file comfi_fast_grnn_torch-0.0.1.tar.gz.

File metadata

  • Download URL: comfi_fast_grnn_torch-0.0.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for comfi_fast_grnn_torch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 98cc157f868f213f1841fe9372eb2fd8e52cb7b39927cde6cb93115f488ad3bf
MD5 c1a8e3b1c9471e19737280aaaa80f44d
BLAKE2b-256 c188f829b9d944ced40e528aa671a7a37214b33c0b16c62bc12e369ba0caa710

See more details on using hashes here.

File details

Details for the file comfi_fast_grnn_torch-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for comfi_fast_grnn_torch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7a3acb9c8a2f34301de6abb877fbc7aaed29ef329477f7aa7edaf957acda09
MD5 58e0719b072b58b9b4601b3a68422e69
BLAKE2b-256 17771cbdb67ad1539b0d3f7b9016de31ce2fe97fcdaa02095a5ffe97cdb58f47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page