[](https://travis-ci.org/ixaxaar/pytorch-sublstm) [](https://badge.fury.io/py/pytorch-sublstm)
This is an implementation of subLSTM described in the paper [Cortical microcircuits as gated-recurrent neural networks, Rui Ponte Costa et al.](https://arxiv.org/abs/1711.02448)
## Install
```bash
pip install pytorch-sublstm
```
## Usage
**Parameters**:
Following are the constructor parameters:
| Argument | Default | Description |
| --- | --- | --- |
| input_size | `None` | Size of the input vectors |
| hidden_size | `None` | Size of hidden units |
| num_layers | `1` | Number of layers in the network |
| bias | `True` | Bias |
| batch_first | `False` | Whether data is fed batch first |
| dropout | `0` | Dropout between layers in the network |
| bidirectional | `False` | If the network is bidirectional |
### Example usage:
#### nn Interface
```python
import torch
from torch.autograd import Variable
from subLSTM.nn import SubLSTM
hidden_size = 20
input_size = 10
seq_len = 5
batch_size = 7
hidden = None
input = Variable(torch.randn(batch_size, seq_len, input_size))
rnn = SubLSTM(input_size, hidden_size, num_layers=2, bias=True, batch_first=True)
# forward pass
output, hidden = rnn(input, hidden)
```
#### Cell Interface
```python
import torch
from torch.autograd import Variable
from subLSTM.nn import SubLSTMCell
hidden_size = 20
input_size = 10
seq_len = 5
batch_size = 7
hidden = None
hx = Variable(torch.randn(batch_size, hidden_size))
cx = Variable(torch.randn(batch_size, hidden_size))
input = Variable(torch.randn(batch_size, input_size))
cell = SubLSTMCell(input_size, hidden_size, bias=True)
(hx, cx) = cell(input, (hx, cx))
```
### Tasks:
A language modeling task is included [here](./tasks/word_language_model/).
Refer to its [README](./tasks/word_language_model/README.md) for more info.
### Attributions:
A lot of the code is recycled from [pytorch](https://pytorch.org)
Metadata
Release files for pytorch-sublstm 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pytorch-sublstm-0.0.2.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytorch_sublstm-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / pytorch-sublstm-0.0.2.tar.gz
| Download URL | pytorch-sublstm-0.0.2.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc87001bab328d50065b005e8ed7d972da68747718d1f803413ad5e4e1b0c970
|
|
BLAKE2b-256 checksum How to use checksums |
98723265439b8fa84f4ad96f22b7a2387113f3baced1794b41db5dab77e7b06f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytorch_sublstm-0.0.2-py3-none-any.whl
| Download URL | pytorch_sublstm-0.0.2-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4aa45da82362f7907ab78f78211eca1101f8c7d88ccce63d4f47f2922e84c66
|
|
BLAKE2b-256 checksum How to use checksums |
08a559a7ff047c5fdaa38f7cc3dd2769a13b1be22661ac1d1c26ff86977c5052
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pytorch-sublstm 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.