MCPcopy Create free account
hub / github.com/apache/singa / TEST

Function TEST

test/singa/test_activation.cc:29–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using singa::Activation;
28using singa::Shape;
29TEST(Activation, Setup) {
30 Activation acti;
31 // EXPECT_EQ("Activation", acti.layer_type());
32
33 singa::LayerConf conf;
34 conf.set_type("singa_relu");
35 singa::ReLUConf* reluconf = conf.mutable_relu_conf();
36 reluconf->set_negative_slope(0.5);
37
38 acti.Setup(Shape{3}, conf);
39 EXPECT_EQ("relu", acti.Mode());
40 EXPECT_EQ(0.5f, acti.Negative_slope());
41}
42
43TEST(Activation, Forward) {
44 const float x[] = {1.0f, 2.0f, 3.0f, -2.0f, -3.0f, -4.0};

Callers

nothing calls this directly

Calls 8

ModeMethod · 0.80
Negative_slopeMethod · 0.80
expFunction · 0.50
tanhFunction · 0.50
SetupMethod · 0.45
ForwardMethod · 0.45
SizeMethod · 0.45
BackwardMethod · 0.45

Tested by

no test coverage detected