--- title: Dilated Recurrent Neural Networks keywords: fastai sidebar: home_sidebar summary: "DRNN pytorch implementation." description: "DRNN pytorch implementation." nb_path: "nbs/models_components__drnn.ipynb" ---
Dilated Recurrent Neural Networks. https://papers.nips.cc/paper/6613-dilated-recurrent-neural-networks.pdf implementation from https://github.com/zalandoresearch/pytorch-dilated-rnn Residual LSTM: Design of a Deep Recurrent Architecture for Distant Speech Recognition. https://arxiv.org/abs/1701.03360 A Dual-Stage Attention-Based recurrent neural network for time series prediction. https://arxiv.org/abs/1704.02971
n_time = 24
batch_size = 3
n_feats = 10
n_output_feats = 20
num_layers = 4
dilations = [2, 4, 5, 9]
for cell_type in ['GRU', 'RNN', 'LSTM', 'ResLSTM']:
model = DRNN(n_input=n_feats, n_hidden=n_output_feats, n_layers=num_layers,
dilations=dilations, cell_type=cell_type)
x = torch.rand(n_time, batch_size, n_feats)
output, hidden = model(x)
test_eq(output.shape, (n_time, batch_size, n_output_feats))