Assume you have an input batch which contains variable length sequences. The batch dimension is:
input: [batch_size, max_time, dim_feature]
and you also stored the length of each sequence in a vector, say sequence_length. Now you can easily get the states output by:
_, state = tf.nn.dynamic_rnn(some_RNN_cell, input, sequence_length=sequence_length)
then you can get both the hidden and cell states output:
state.h: hidden states output, [batch_size, hidden_states_size]
state.c: cell states output
I give credit to these two sources:
https://danijar.com/variable-sequence-lengths-in-tensorflow/
https://github.com/shane-settle/neural-acoustic-word-embeddings/blob/4cc3878e6715860bcce202aea7c5a6b7284292a1/code/lstm.py#L25
Showing posts with label Deep learning. Show all posts
Showing posts with label Deep learning. Show all posts
Tuesday, February 20, 2018
Sunday, January 14, 2018
Sheet music and audio multimodal learning
https://arxiv.org/abs/1612.05050
Toward score following in sheet music: use classification to find note head position in the sheet music. Given an audio spectrogram patch, classify the location bucket.
https://arxiv.org/abs/1707.09887
Learning audio - sheet music correspondences for score identification and offline alignment: pair wise ranking objective and contrastive loss (siamese), what's the difference?
Toward score following in sheet music: use classification to find note head position in the sheet music. Given an audio spectrogram patch, classify the location bucket.
https://arxiv.org/abs/1707.09887
Learning audio - sheet music correspondences for score identification and offline alignment: pair wise ranking objective and contrastive loss (siamese), what's the difference?
Wednesday, December 27, 2017
Capacity and trainability of different RNNs
In the paper "Capacity and trainability in RNNs": https://arxiv.org/pdf/1611.09913.pdf
The author claims that all common RNNs have similar capacity. The Vanilla RNN is super hard to train. If the task is hard to learn, one should choose gated architectures, in which GRU is the most learnable for shallow networks, +RNN (Intersection RNN) performs the best for the deep networks. Although LSTM is extremely reliable, it doesn't perform the best. If the training environment is uncertain, the author suggests using GRU or +RNN.
Another paper "On the state of the art of evaluation in neural language models" https://arxiv.org/pdf/1707.05589.pdf The authors also found that the standard LSTM performs the best among 3 different architectures (LSTM, Recurrent highway networks and Neural architecture search). The models are trained using a modified ADAM optimizer. Hyperparameters including learning rate, input embedding ratio, input dropout, output dropout, weight decay, are tuned by batched GP bandits.
It is also shown that, in the Penn Treebank experiment, for the recurrent state, the variational dropout helps, the recurrent dropout indicates no advantage.
The author claims that all common RNNs have similar capacity. The Vanilla RNN is super hard to train. If the task is hard to learn, one should choose gated architectures, in which GRU is the most learnable for shallow networks, +RNN (Intersection RNN) performs the best for the deep networks. Although LSTM is extremely reliable, it doesn't perform the best. If the training environment is uncertain, the author suggests using GRU or +RNN.
Another paper "On the state of the art of evaluation in neural language models" https://arxiv.org/pdf/1707.05589.pdf The authors also found that the standard LSTM performs the best among 3 different architectures (LSTM, Recurrent highway networks and Neural architecture search). The models are trained using a modified ADAM optimizer. Hyperparameters including learning rate, input embedding ratio, input dropout, output dropout, weight decay, are tuned by batched GP bandits.
It is also shown that, in the Penn Treebank experiment, for the recurrent state, the variational dropout helps, the recurrent dropout indicates no advantage.
Labels:
Deep learning,
GRU,
LSTM,
Recurrent neural networks,
RNNs
Location:
Beijing, China
Sunday, December 24, 2017
Deep learning practice and trends, some key points
I went through the 1st part of the tutorial: practice. Below are some key points in Oriol's talk:
CNN:
(1) The slide 7 Deep learning: zooming in is amazing! He listed the deep learning model construction elements and sorted them into different categories: Non-linearities, Optimizer, connectivity pattern, loss and hyper-parameters.
(2) The slide 21 which shows the convolution animation is great! very intuitive to understand the convolution mechanism.
(3) Slide 27 building very deep ConvNets: using deeper architecture and small filter size 3*3 will result in a large receptive field and less parameter size than using large filters.
(4) Slide 35 U-net: for image segmentation, bottleneck encoder-decoder with skip connection.
Seq2seq:
(1) Attention!
(2) Slide 62: tricks!
Video:
Slides: https://docs.google.com/presentation/d/e/2PACX-1vQMZsWfjjLLz_wi8iaMxHKawuTkdqeA3Gw00wy5dBHLhAkuLEvhB7k-4LcO5RQEVFzZXfS6ByABaRr4/pub?slide=id.g2a19ddb012_0_654
CNN:
(1) The slide 7 Deep learning: zooming in is amazing! He listed the deep learning model construction elements and sorted them into different categories: Non-linearities, Optimizer, connectivity pattern, loss and hyper-parameters.
(2) The slide 21 which shows the convolution animation is great! very intuitive to understand the convolution mechanism.
(3) Slide 27 building very deep ConvNets: using deeper architecture and small filter size 3*3 will result in a large receptive field and less parameter size than using large filters.
(4) Slide 35 U-net: for image segmentation, bottleneck encoder-decoder with skip connection.
Seq2seq:
(1) Attention!
(2) Slide 62: tricks!
Video:
Slides: https://docs.google.com/presentation/d/e/2PACX-1vQMZsWfjjLLz_wi8iaMxHKawuTkdqeA3Gw00wy5dBHLhAkuLEvhB7k-4LcO5RQEVFzZXfS6ByABaRr4/pub?slide=id.g2a19ddb012_0_654
Labels:
Deep learning,
NIPS 2017
Location:
Beijing, China
Friday, November 24, 2017
Deep learning, where are you going?
A talk by Kyunghyun Cho, a professor from New York univ. The name is "Deep learning, where are you going?" Things to take away for me:
(1) Currently, most people using neural network to do one specific task. They grab the data and annotation, build an architecture and train the model. However, as time goes, the trained model become isolated because new information comes around. In such way, we have to retrain the model with newly collected data. So how could we benefit with the pre-trained model? The idea would be combining different pre-trained models to do a more complex task or using another neural net to interpret the pre-trained model.
(2) The idea of multilingual translation is to train a shared continuous language space (word, character). He found char2char model is better than word2word or word2char models. Additionally, you can do mixed languages translation where the input sentence is mixed with such as English, French, etc.
(1) Currently, most people using neural network to do one specific task. They grab the data and annotation, build an architecture and train the model. However, as time goes, the trained model become isolated because new information comes around. In such way, we have to retrain the model with newly collected data. So how could we benefit with the pre-trained model? The idea would be combining different pre-trained models to do a more complex task or using another neural net to interpret the pre-trained model.
(2) The idea of multilingual translation is to train a shared continuous language space (word, character). He found char2char model is better than word2word or word2char models. Additionally, you can do mixed languages translation where the input sentence is mixed with such as English, French, etc.
Subscribe to:
Posts (Atom)