Skip to main content

Light Recurrent Unit

Project description

Light Recurrent Unit - Pytorch (wip)

Implementation of the Light Recurrent Unit in Pytorch

Install

$ pip install light-recurrent-unit-pytorch

Usage

import torch
from light_recurrent_unit_pytorch import LightRecurrentUnitCell

lru_cell = LightRecurrentUnitCell(256)

x = torch.randn(2, 256)
hidden = torch.randn(2, 256)

next_hidden = lru_cell(x, hidden) # (2, 256)

Single layer

import torch
from light_recurrent_unit_pytorch import LightRecurrentUnitLayer

lru_cell = LightRecurrentUnitLayer(256)

x = torch.randn(2, 1024, 256)
hidden = torch.randn(2, 256)

output = lru_cell(x, hidden) # (2, 1024, 256)
assert x.shape == output.shape

Citations

@Article{electronics13163204,
    AUTHOR = {Ye, Hong and Zhang, Yibing and Liu, Huizhou and Li, Xuannong and Chang, Jiaming and Zheng, Hui},
    TITLE = {Light Recurrent Unit: Towards an Interpretable Recurrent Neural Network for Modeling Long-Range Dependency},
    JOURNAL = {Electronics},
    VOLUME = {13},
    YEAR = {2024},
    NUMBER = {16},
    ARTICLE-NUMBER = {3204},
    URL = {https://www.mdpi.com/2079-9292/13/16/3204},
    ISSN = {2079-9292},
    DOI = {10.3390/electronics13163204}
}

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

light_recurrent_unit_pytorch-0.0.2.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

File details

Details for the file light_recurrent_unit_pytorch-0.0.2.tar.gz.

File metadata

File hashes

Hashes for light_recurrent_unit_pytorch-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9bd278f122673dba2f242a20f05f6c3def6222edeef181fb5936fa904ac695c7
MD5 7afef8dfaaab08ed7285840af898eb89
BLAKE2b-256 e169af5d07aa2815a3ab8305aa2ae51921db2d0e77a9a309e600b629b047fd8d

See more details on using hashes here.

File details

Details for the file light_recurrent_unit_pytorch-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for light_recurrent_unit_pytorch-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a50698d90a9bb09151c190eab8bbd6a41a6440a592589bab7fc84b3eed869e08
MD5 686ea1c019abdfc666a7bc29b7c30c2a
BLAKE2b-256 2ec22953bfed2ad90041a20faa9dca5096a6ad80a1c2bdc02086675713357812

See more details on using hashes here.

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