record_single(attention, [(2, 5, 7), (2, 3, 7), (2, 3, 7)],
"attention_batched", {}, input_type='float')
-inspect_file("conv_sb_no_overlap.nnlayergolden")
+ lstm = K.layers.LSTM(units=5,
+ recurrent_activation="sigmoid",
+ activation="tanh",
+ return_sequences=False,
+ return_state=False)
+ record_single(lstm, (3, 1, 7), "lstm_single_step")
+ record_single(lstm, (3, 4, 7), "lstm_multi_step")
+
+ lstm = K.layers.LSTM(units=5,
+ recurrent_activation="sigmoid",
+ activation="tanh",
+ return_sequences=True,
+ return_state=False)
+ record_single(lstm, (3, 1, 7), "lstm_single_step_seq")
+ record_single(lstm, (3, 4, 7), "lstm_multi_step_seq")
+
+ lstm = K.layers.LSTM(units=5,
+ recurrent_activation="tanh",
+ activation="sigmoid",
+ return_sequences=True,
+ return_state=False)
+ record_single(lstm, (3, 4, 7), "lstm_multi_step_seq_act")
+
+inspect_file("lstm_single_step_seq.nnlayergolden")
nntrainer::LSTMLayer::type, {"unit=1"}, 0, false, 1);
INSTANTIATE_TEST_CASE_P(LSTM, LayerSemantics, ::testing::Values(semantic_lstm));
+
+auto lstm_single_step = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::LSTMLayer>, {"unit=5"}, "3:1:1:7",
+ "lstm_single_step.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto lstm_multi_step = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::LSTMLayer>, {"unit=5"}, "3:1:4:7",
+ "lstm_multi_step.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto lstm_single_step_seq = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::LSTMLayer>,
+ {"unit=5", "return_sequences=true"}, "3:1:1:7",
+ "lstm_single_step_seq.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto lstm_multi_step_seq = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::LSTMLayer>,
+ {"unit=5", "return_sequences=true"}, "3:1:4:7",
+ "lstm_multi_step_seq.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto lstm_multi_step_seq_act_orig = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::LSTMLayer>,
+ {"unit=5", "return_sequences=true", "hidden_state_activation=tanh",
+ "recurrent_activation=sigmoid"},
+ "3:1:4:7", "lstm_multi_step_seq.nnlayergolden",
+ LayerGoldenTestParamOptions::DEFAULT);
+
+auto lstm_multi_step_seq_act = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::LSTMLayer>,
+ {"unit=5", "return_sequences=true", "hidden_state_activation=sigmoid",
+ "recurrent_activation=tanh"},
+ "3:1:4:7", "lstm_multi_step_seq_act.nnlayergolden",
+ LayerGoldenTestParamOptions::DEFAULT);
+
+INSTANTIATE_TEST_CASE_P(LSTM, LayerGoldenTest,
+ ::testing::Values(lstm_single_step, lstm_multi_step,
+ lstm_single_step_seq,
+ lstm_multi_step_seq,
+ lstm_multi_step_seq_act_orig,
+ lstm_multi_step_seq_act));