summaryrefslogtreecommitdiff
path: root/src/caffe/test/test_net.cpp
diff options
context:
space:
mode:
authorSergio <sguada@gmail.com>2014-06-19 16:45:08 -0700
committerSergio <sguada@gmail.com>2014-06-19 16:45:08 -0700
commit03cd25ce658c0270dd8bcf4c4cc0ff206f87aa05 (patch)
treeeda00e74d9efe165ef6ef5edb9b07c5adb25ced3 /src/caffe/test/test_net.cpp
parentf5853bc2eb85dda3e44269e6de8a539d0f54d5a1 (diff)
downloadcaffeonacl-03cd25ce658c0270dd8bcf4c4cc0ff206f87aa05.tar.gz
caffeonacl-03cd25ce658c0270dd8bcf4c4cc0ff206f87aa05.tar.bz2
caffeonacl-03cd25ce658c0270dd8bcf4c4cc0ff206f87aa05.zip
Modified test_net to check loss layer with top
Diffstat (limited to 'src/caffe/test/test_net.cpp')
-rw-r--r--src/caffe/test/test_net.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/caffe/test/test_net.cpp b/src/caffe/test/test_net.cpp
index 1e43a038..7f2f67b5 100644
--- a/src/caffe/test/test_net.cpp
+++ b/src/caffe/test/test_net.cpp
@@ -64,6 +64,7 @@ class NetTest : public ::testing::Test {
" type: SOFTMAX_LOSS "
" bottom: 'innerproduct' "
" bottom: 'label' "
+ " top: 'top_loss' "
"} ";
NetParameter param;
CHECK(google::protobuf::TextFormat::ParseFromString(proto, &param));
@@ -81,6 +82,7 @@ TYPED_TEST(NetTest, TestHasBlob) {
EXPECT_TRUE(this->net_->has_blob("label"));
EXPECT_TRUE(this->net_->has_blob("innerproduct"));
EXPECT_FALSE(this->net_->has_blob("loss"));
+ EXPECT_TRUE(this->net_->has_blob("top_loss"));
}
TYPED_TEST(NetTest, TestGetBlob) {
@@ -88,6 +90,7 @@ TYPED_TEST(NetTest, TestGetBlob) {
EXPECT_EQ(this->net_->blob_by_name("label"), this->net_->blobs()[1]);
EXPECT_EQ(this->net_->blob_by_name("innerproduct"), this->net_->blobs()[2]);
EXPECT_FALSE(this->net_->blob_by_name("loss"));
+ EXPECT_EQ(this->net_->blob_by_name("top_loss"), this->net_->blobs()[3]);
}
TYPED_TEST(NetTest, TestHasLayer) {