Human Activity Recognition example using TensorFlow on smartphone sensors dataset and an LSTM RNN. Classifying the type of movement amongst six activity categories - Guillaume Chevalier
MIT License
3.33k
stars
935
forks
source link
Why change the dimensional of inputs from n_inputs to n_hidden? #17
I'm interested in this brillirant project but I have some doubts about it. Hopefully someone can help me a little, thank you very much!
I used to believe num_units(config.n_hidden=32) of BasicLSTMCell is the dimension of the hidden cell state, while input_size(config.n_inputs=9) is the dimension of a input vector, i.e. one set of 9-axis sensor data, at one time in a time serie, of one sliding window, out of a batch.
Could somebody tell me if I'm getting this right?
Also, in
https://github.com/guillaume-chevalier/LSTM-Human-Activity-Recognition/blob/53132c8708990bef2ee46c05d7d5054718eea73e/lstm.py#L141-L145
Why transform the input size from 9 to 32? Is it a neccessary step to make the model mathematically right? e.g. My guess is to intentionally make the input, output and hidden state of a cell all at the same dimension? (if true, how can we benefit from it? Cause as far as I know, the LSTM cell would concatenate the inputs _X and the hidden state ht-1, so with and without this relu transformation , the only diffrence is in the weight mapping inside LSTM cell: (9 + 32)--->(32) versus (32 + 32)-->(32)?)
I kinda want to know for sure how does tf.contrib.rnn.static_rnn() combine "inputs + hidden state" in the forward propagation or what's the dimensions of the weight matrix inside the LSTM?
Or maybe it is just a "fully connected input layer" or something like that, which helped the overall learning process? Actually, I've tried to remove it. The code still worked but the accuracy dropped a little. So I'm even more confused. Please help me with this!
I'm interested in this brillirant project but I have some doubts about it. Hopefully someone can help me a little, thank you very much! I used to believe num_units(config.n_hidden=32) of BasicLSTMCell is the dimension of the hidden cell state, while input_size(config.n_inputs=9) is the dimension of a input vector, i.e. one set of 9-axis sensor data, at one time in a time serie, of one sliding window, out of a batch. Could somebody tell me if I'm getting this right?
Also, in https://github.com/guillaume-chevalier/LSTM-Human-Activity-Recognition/blob/53132c8708990bef2ee46c05d7d5054718eea73e/lstm.py#L141-L145 Why transform the input size from 9 to 32? Is it a neccessary step to make the model mathematically right? e.g. My guess is to intentionally make the input, output and hidden state of a cell all at the same dimension? (if true, how can we benefit from it? Cause as far as I know, the LSTM cell would concatenate the inputs _X and the hidden state ht-1, so with and without this relu transformation , the only diffrence is in the weight mapping inside LSTM cell: (9 + 32)--->(32) versus (32 + 32)-->(32)?)
I kinda want to know for sure how does tf.contrib.rnn.static_rnn() combine "inputs + hidden state" in the forward propagation or what's the dimensions of the weight matrix inside the LSTM?
Or maybe it is just a "fully connected input layer" or something like that, which helped the overall learning process? Actually, I've tried to remove it. The code still worked but the accuracy dropped a little. So I'm even more confused. Please help me with this!