All Projects → kamo-naoyuki → pytorch_convolutional_rnn

kamo-naoyuki / pytorch_convolutional_rnn

Licence: other
PyTorch implementation of Convolutional Recurrent Neural Network

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytorch convolutional rnn

Crnn Audio Classification
UrbanSound classification using Convolutional Recurrent Networks in PyTorch
Stars: ✭ 235 (+100.85%)
Mutual labels:  rnn, crnn
time-series-forecasting-tensorflowjs
Pull stock prices from online API and perform predictions using Long Short Term Memory (LSTM) with TensorFlow.js framework
Stars: ✭ 96 (-17.95%)
Mutual labels:  rnn
NoiseReductionUsingGRU
This is my graduation project in BIT. Title: Noise Reduction Using GRU.
Stars: ✭ 25 (-78.63%)
Mutual labels:  rnn
Sequence-Models-coursera
Sequence Models by Andrew Ng on Coursera. Programming Assignments and Quiz Solutions.
Stars: ✭ 53 (-54.7%)
Mutual labels:  rnn
ScrambleTests
Running compostionality tests on InferSent embedding on SNLI
Stars: ✭ 16 (-86.32%)
Mutual labels:  rnn
Dense BiLSTM
Tensorflow Implementation of Densely Connected Bidirectional LSTM with Applications to Sentence Classification
Stars: ✭ 48 (-58.97%)
Mutual labels:  rnn
myDL
Deep Learning
Stars: ✭ 18 (-84.62%)
Mutual labels:  rnn
tiny-rnn
Lightweight C++11 library for building deep recurrent neural networks
Stars: ✭ 41 (-64.96%)
Mutual labels:  rnn
Course-Project---Speech-Driven-Facial-Animation
ECE 535 - Course Project, Deep Learning Framework
Stars: ✭ 63 (-46.15%)
Mutual labels:  rnn
PFL-Non-IID
The origin of the Non-IID phenomenon is the personalization of users, who generate the Non-IID data. With Non-IID (Not Independent and Identically Distributed) issues existing in the federated learning setting, a myriad of approaches has been proposed to crack this hard nut. In contrast, the personalized federated learning may take the advantage…
Stars: ✭ 58 (-50.43%)
Mutual labels:  rnn
rnn2d
CPU and GPU implementations of some 2D RNN layers
Stars: ✭ 26 (-77.78%)
Mutual labels:  rnn
question-pair
A siamese LSTM to detect sentence/question pairs.
Stars: ✭ 25 (-78.63%)
Mutual labels:  rnn
CS231n
My solutions for Assignments of CS231n: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 30 (-74.36%)
Mutual labels:  rnn
GAN-RNN Timeseries-imputation
Recurrent GAN for imputation of time series data. Implemented in TensorFlow 2 on Wikipedia Web Traffic Forecast dataset from Kaggle.
Stars: ✭ 107 (-8.55%)
Mutual labels:  rnn
Signal-Classification-Comparison
Classify signal using Deep Learning on Tensorflow and various machine learning models.
Stars: ✭ 19 (-83.76%)
Mutual labels:  rnn
Base-On-Relation-Method-Extract-News-DA-RNN-Model-For-Stock-Prediction--Pytorch
基於關聯式新聞提取方法之雙階段注意力機制模型用於股票預測
Stars: ✭ 33 (-71.79%)
Mutual labels:  rnn
medical-diagnosis-cnn-rnn-rcnn
分别使用rnn/cnn/rcnn来实现根据患者描述,进行疾病诊断
Stars: ✭ 39 (-66.67%)
Mutual labels:  rnn
tensorflow-crnn
tensorflow slim Implementation crnn
Stars: ✭ 17 (-85.47%)
Mutual labels:  crnn
ssd detectors
SSD-based object and text detection with Keras, SSD, DSOD, TextBoxes, SegLink, TextBoxes++, CRNN
Stars: ✭ 295 (+152.14%)
Mutual labels:  crnn
totally humans
rnn trained on r/totallynotrobots 🤖
Stars: ✭ 23 (-80.34%)
Mutual labels:  rnn

pytorch_convolutional_rnn

The pytorch implemenation for convolutional rnn is alreaedy exisitng other than my module, for example.

However, there are no modules supporting neither variable length tensor nor bidirectional rnn.

I implemented AutogradConvRNN by referring to AutogradRNN at https://github.com/pytorch/pytorch/blob/master/torch/nn/_functions/rnn.py, so my convolutional RNN modules have similar structure to torch.nn.RNN and supports the above features as it has.

The benefit of using AutogradConvRNN is not only that it enables my modules to have the same interface as torch.nn.RNN, but makes it very easy to implement many kinds of CRNN, such as CLSTM, CGRU.

Require

  • python3 (Not supporting python2 because I prefer type annotation)
  • pytorch0.4.0, python1.0.0

Feature

  • Implemented at python level, without any additional CUDA kernel, c++ codes.
  • Convolutional RNN, Convolutional LSTM, Convolutional Peephole LSTM, Convolutional GRU
  • Unidirectional, Bidirectional
  • 1d, 2d, 3d
  • Supporting PackedSequence (Supporting variable length tensor)
  • Supporting nlayers RNN and RNN Cell, both.
  • Not supporting different hidden sizes for each layers (But, it is very easy to implement it by stacking 1-layer-CRNNs)

Example

  • With pack_padded_sequence
import torch
import convolutional_rnn
from torch.nn.utils.rnn import pack_padded_sequence

in_channels = 2
net = convolutional_rnn.Conv3dGRU(in_channels=in_channels,  # Corresponds to input size
                                  out_channels=5,  # Corresponds to hidden size
                                  kernel_size=(3, 4, 6),  # Int or List[int]
                                  num_layers=2,
                                  bidirectional=True,
                                  dilation=2, stride=2, dropout=0.5)
length = 3
batchsize = 2
lengths = [3, 1]
shape = (10, 14, 18)
x = pack_padded_sequence(torch.randn(length, batchsize, in_channels, *shape), lengths, batch_first=False)
h = None
y, h = net(x, h)
  • Without pack_padded_sequence
import torch
import convolutional_rnn
from torch.nn.utils.rnn import pack_padded_sequence

in_channels = 2
net = convolutional_rnn.Conv2dLSTM(in_channels=in_channels,  # Corresponds to input size
                                   out_channels=5,  # Corresponds to hidden size
                                   kernel_size=3,  # Int or List[int]
                                   num_layers=2,
                                   bidirectional=True,
                                   dilation=2, stride=2, dropout=0.5,
                                   batch_first=True)
length = 3
batchsize = 2
shape = (10, 14)
x = torch.randn(batchsize, length, in_channels, *shape)
h = None
y, h = net(x, h)
  • With Cell
import torch
import convolutional_rnn
cell = convolutional_rnn.Conv2dLSTMCell(in_channels=3, out_channels=5, kernel_size=3).cuda()
time = 6
input = torch.randn(time, 16, 3, 10, 10).cuda()
output = []
for i in range(time):
    if i == 0:
        hx, cx = cell(input[i])
    else:
        hx, cx = cell(input[i], (hx, cx))
    output.append(hx)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].