return_state=False)
record_single(lstm, (3, 4, 7), "lstm_multi_step_seq_act")
-inspect_file("lstm_single_step_seq.nnlayergolden")
+ gru = K.layers.GRU(units=5,
+ recurrent_activation="sigmoid",
+ activation="tanh",
+ return_sequences=False,
+ return_state=False)
+ record_single(gru, (3, 1, 7), "gru_single_step")
+ record_single(gru, (3, 4, 7), "gru_multi_step")
+
+ gru = K.layers.GRU(units=5,
+ recurrent_activation="sigmoid",
+ activation="tanh",
+ return_sequences=True,
+ return_state=False)
+ record_single(gru, (3, 1, 7), "gru_single_step_seq")
+ record_single(gru, (3, 4, 7), "gru_multi_step_seq", input_type='float')
+
+ gru = K.layers.GRU(units=5,
+ recurrent_activation="tanh",
+ activation="sigmoid",
+ return_sequences=True,
+ return_state=False)
+ record_single(gru, (3, 4, 7), "gru_multi_step_seq_act")
+
+inspect_file("gru_single_step_seq.nnlayergolden")
nntrainer::GRULayer::type, {"unit=1"}, 0, false, 1);
INSTANTIATE_TEST_CASE_P(GRU, LayerSemantics, ::testing::Values(semantic_gru));
+
+auto gru_single_step = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::GRULayer>, {"unit=5"}, "3:1:1:7",
+ "gru_single_step.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto gru_multi_step = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::GRULayer>, {"unit=5"}, "3:1:4:7",
+ "gru_multi_step.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto gru_single_step_seq = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::GRULayer>,
+ {"unit=5", "return_sequences=true"}, "3:1:1:7",
+ "gru_single_step_seq.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto gru_multi_step_seq = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::GRULayer>,
+ {"unit=5", "return_sequences=true"}, "3:1:4:7",
+ "gru_multi_step_seq.nnlayergolden", LayerGoldenTestParamOptions::DEFAULT);
+
+auto gru_multi_step_seq_act_orig = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::GRULayer>,
+ {"unit=5", "return_sequences=true", "hidden_state_activation=tanh",
+ "recurrent_activation=sigmoid"},
+ "3:1:4:7", "gru_multi_step_seq.nnlayergolden",
+ LayerGoldenTestParamOptions::DEFAULT);
+
+auto gru_multi_step_seq_act = LayerGoldenTestParamType(
+ nntrainer::createLayer<nntrainer::GRULayer>,
+ {"unit=5", "return_sequences=true", "hidden_state_activation=sigmoid",
+ "recurrent_activation=tanh"},
+ "3:1:4:7", "gru_multi_step_seq_act.nnlayergolden",
+ LayerGoldenTestParamOptions::DEFAULT);
+
+INSTANTIATE_TEST_CASE_P(GRU, LayerGoldenTest,
+ ::testing::Values(gru_single_step, gru_multi_step,
+ gru_single_step_seq,
+ gru_multi_step_seq,
+ gru_multi_step_seq_act_orig,
+ gru_multi_step_seq_act));