Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unittest] Add constant DerivativeLossLayer unittest #2766

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/unittest/layers/unittest_layers_loss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <gtest/gtest.h>

#include <constant_derivative_loss_layer.h>
#include <cross_entropy_loss_layer.h>
#include <cross_entropy_sigmoid_loss_layer.h>
#include <cross_entropy_softmax_loss_layer.h>
Expand All @@ -34,11 +35,17 @@ auto semantic_loss_mse = LayerSemanticsParamType(
nntrainer::MSELossLayer::type, {},
LayerCreateSetPropertyOptions::AVAILABLE_FROM_APP_CONTEXT, false, 1);

auto semantic_loss_constant_derivative = LayerSemanticsParamType(
nntrainer::createLayer<nntrainer::ConstantDerivativeLossLayer>,
nntrainer::ConstantDerivativeLossLayer::type, {},
LayerCreateSetPropertyOptions::AVAILABLE_FROM_APP_CONTEXT, false, 1);

auto semantic_loss_cross = LayerSemanticsParamType(
nntrainer::createLayer<nntrainer::CrossEntropyLossLayer>,
nntrainer::CrossEntropyLossLayer::type, {}, 0, true, 1);

GTEST_PARAMETER_TEST(LossCross, LayerSemantics,
::testing::Values(semantic_loss_cross, semantic_loss_mse,
semantic_loss_cross_softmax,
semantic_loss_cross_sigmoid));
semantic_loss_cross_sigmoid,
semantic_loss_constant_derivative));
Loading