pytorch-stateful-lstm
Free software: MIT license
Features
Pytorch LSTM implementation powered by Libtorch, and with the support of:
Hidden/Cell Clip.
Skip Connections.
Variational Dropout & DropConnect.
Managed Initial State.
Built-in TBPTT.
Benchmark: https://github.com/cnt-dev/pytorch-stateful-lstm/tree/master/benchmark
Install
Prerequisite: torch>=1.0.0, supported C++11 compiler (see here). To install through pip:
pip install pytorch-stateful-lstm
Usage
Example:
import torch
from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence
from pytorch_stateful_lstm import StatefulUnidirectionalLstm
lstm = StatefulUnidirectionalLstm(
num_layers=2,
input_size=3,
hidden_size=5,
cell_size=7,
)
inputs = pack_padded_sequence(torch.rand(4, 5, 3), [5, 4, 2, 1], batch_first=True)
raw_packed_outputs, lstm_state = lstm(
inputs.data,
inputs.batch_sizes
)
outputs = PackedSequence(raw_packed_outputs, inputs.batch_sizes)
For the definition of parameters, see https://github.com/cnt-dev/pytorch-stateful-lstm/tree/master/extension.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2019-01-03)
First release on PyPI.
Release files for pytorch-stateful-lstm 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytorch_stateful_lstm-1.6.0.tar.gz | 18.6 kB | Details |
Release files / pytorch_stateful_lstm-1.6.0.tar.gz
| Download URL | pytorch_stateful_lstm-1.6.0.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13b23fd6d68198489f7ded7e413ae99ca770a2e27ec1b0fcd4347f0f0408d4d4
|
|
BLAKE2b-256 checksum How to use checksums |
2698684219d6b443dbb1cbbcea88859821a1126d4ac2b75798a9869f39eecbf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|