Caffe Stacking LSTMs
up vote
1
down vote
favorite
I have an input feature sequence of size [3, 1, 1024]
, clip1
variable [0, 1, 1]
and clip2
variable [1, 1, 0]
. What I aim to do is to stack two LSTM layers to go through this feature sequence first from left to right and then right to left. My existing prototxt is as follows:
input: "data"
input_shape { dim: 3 dim: 1 dim: 1024}
input: "clip1"
input_shape { dim: 3 dim: 1}
input: "clip2"
input_shape { dim: 3 dim: 1}
layer {
name: "lstm1"
type: "LSTM"
bottom: "data"
bottom: "clip"
top: "lstm1"
recurrent_param {
num_output: 256
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "lstm2"
type: "LSTM"
bottom: "lstm1"
bottom: "clip2"
top: "lstm2"
recurrent_param {
num_output: 512
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "fc8-final"
type: "InnerProduct"
bottom: "lstm2"
top: "fc8-final"
param {
lr_mult: 10
decay_mult: 1
}
param {
lr_mult: 20
decay_mult: 0
}
inner_product_param {
num_output: 101
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
axis: 2
}
}
layer {
name: "probs"
type: "Softmax"
bottom: "fc8-final"
top: "probs"
softmax_param {
axis: 2
}
}
layer {
bottom: "probs"
bottom: "probs"
top: "loss"
name: "dummyLoss"
type: "EuclideanLoss"
}
Question:
Is my prototxt the correct way to implement my idea? or should I slice lstm1
blob and concatenate the sliced blobs in a reverse order and then input the concatenated blob to lstm2
layer?
caffe lstm
add a comment |
up vote
1
down vote
favorite
I have an input feature sequence of size [3, 1, 1024]
, clip1
variable [0, 1, 1]
and clip2
variable [1, 1, 0]
. What I aim to do is to stack two LSTM layers to go through this feature sequence first from left to right and then right to left. My existing prototxt is as follows:
input: "data"
input_shape { dim: 3 dim: 1 dim: 1024}
input: "clip1"
input_shape { dim: 3 dim: 1}
input: "clip2"
input_shape { dim: 3 dim: 1}
layer {
name: "lstm1"
type: "LSTM"
bottom: "data"
bottom: "clip"
top: "lstm1"
recurrent_param {
num_output: 256
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "lstm2"
type: "LSTM"
bottom: "lstm1"
bottom: "clip2"
top: "lstm2"
recurrent_param {
num_output: 512
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "fc8-final"
type: "InnerProduct"
bottom: "lstm2"
top: "fc8-final"
param {
lr_mult: 10
decay_mult: 1
}
param {
lr_mult: 20
decay_mult: 0
}
inner_product_param {
num_output: 101
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
axis: 2
}
}
layer {
name: "probs"
type: "Softmax"
bottom: "fc8-final"
top: "probs"
softmax_param {
axis: 2
}
}
layer {
bottom: "probs"
bottom: "probs"
top: "loss"
name: "dummyLoss"
type: "EuclideanLoss"
}
Question:
Is my prototxt the correct way to implement my idea? or should I slice lstm1
blob and concatenate the sliced blobs in a reverse order and then input the concatenated blob to lstm2
layer?
caffe lstm
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have an input feature sequence of size [3, 1, 1024]
, clip1
variable [0, 1, 1]
and clip2
variable [1, 1, 0]
. What I aim to do is to stack two LSTM layers to go through this feature sequence first from left to right and then right to left. My existing prototxt is as follows:
input: "data"
input_shape { dim: 3 dim: 1 dim: 1024}
input: "clip1"
input_shape { dim: 3 dim: 1}
input: "clip2"
input_shape { dim: 3 dim: 1}
layer {
name: "lstm1"
type: "LSTM"
bottom: "data"
bottom: "clip"
top: "lstm1"
recurrent_param {
num_output: 256
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "lstm2"
type: "LSTM"
bottom: "lstm1"
bottom: "clip2"
top: "lstm2"
recurrent_param {
num_output: 512
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "fc8-final"
type: "InnerProduct"
bottom: "lstm2"
top: "fc8-final"
param {
lr_mult: 10
decay_mult: 1
}
param {
lr_mult: 20
decay_mult: 0
}
inner_product_param {
num_output: 101
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
axis: 2
}
}
layer {
name: "probs"
type: "Softmax"
bottom: "fc8-final"
top: "probs"
softmax_param {
axis: 2
}
}
layer {
bottom: "probs"
bottom: "probs"
top: "loss"
name: "dummyLoss"
type: "EuclideanLoss"
}
Question:
Is my prototxt the correct way to implement my idea? or should I slice lstm1
blob and concatenate the sliced blobs in a reverse order and then input the concatenated blob to lstm2
layer?
caffe lstm
I have an input feature sequence of size [3, 1, 1024]
, clip1
variable [0, 1, 1]
and clip2
variable [1, 1, 0]
. What I aim to do is to stack two LSTM layers to go through this feature sequence first from left to right and then right to left. My existing prototxt is as follows:
input: "data"
input_shape { dim: 3 dim: 1 dim: 1024}
input: "clip1"
input_shape { dim: 3 dim: 1}
input: "clip2"
input_shape { dim: 3 dim: 1}
layer {
name: "lstm1"
type: "LSTM"
bottom: "data"
bottom: "clip"
top: "lstm1"
recurrent_param {
num_output: 256
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "lstm2"
type: "LSTM"
bottom: "lstm1"
bottom: "clip2"
top: "lstm2"
recurrent_param {
num_output: 512
weight_filler {
type: "gaussian"
std: 0.1
}
bias_filler {
type: "constant"
value: 0
}
}
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 1
}
}
layer {
name: "fc8-final"
type: "InnerProduct"
bottom: "lstm2"
top: "fc8-final"
param {
lr_mult: 10
decay_mult: 1
}
param {
lr_mult: 20
decay_mult: 0
}
inner_product_param {
num_output: 101
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
axis: 2
}
}
layer {
name: "probs"
type: "Softmax"
bottom: "fc8-final"
top: "probs"
softmax_param {
axis: 2
}
}
layer {
bottom: "probs"
bottom: "probs"
top: "loss"
name: "dummyLoss"
type: "EuclideanLoss"
}
Question:
Is my prototxt the correct way to implement my idea? or should I slice lstm1
blob and concatenate the sliced blobs in a reverse order and then input the concatenated blob to lstm2
layer?
caffe lstm
caffe lstm
asked Nov 7 at 7:32
Johnnylin
161113
161113
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185141%2fcaffe-stacking-lstms%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password