DiSMEC++
dense_test.cpp File Reference
#include "utils/macros.h"
#include "doctest.h"
#include "dense.h"
#include "utils/eigen_generic.h"

Go to the source code of this file.

Functions

 TEST_CASE ("get dense weights errors")
 
 TEST_CASE ("set dense weights errors")
 
 TEST_CASE ("get/set dense weights round-trip")
 
 TEST_CASE ("predict_scores checks")
 
 TEST_CASE ("partial model")
 
 TEST_CASE ("DenseModel ctor consistency")
 

Function Documentation

◆ TEST_CASE() [1/6]

TEST_CASE ( "DenseModel ctor consistency"  )
Test:
This test verifies that the constructor of DenseModel throws an error if the model specifications are impossible.

Definition at line 113 of file dense_test.cpp.

◆ TEST_CASE() [2/6]

TEST_CASE ( "get dense weights errors"  )
Test:
We check the that the following result in an exception when getting the label weights:
  • supplying a target vector of non-matching size
  • accessing an invalid label

Definition at line 22 of file dense_test.cpp.

◆ TEST_CASE() [3/6]

TEST_CASE ( "get/set dense weights round-trip"  )
Test:
This test verifies that setting and getting weights for labels round-trips.

Definition at line 61 of file dense_test.cpp.

◆ TEST_CASE() [4/6]

TEST_CASE ( "partial model"  )
Test:
This test verifies the partial model interface part of the Model base class. We use DenseModel as the instantiation. This doubles as a test for the DenseModel constructors.

Definition at line 94 of file dense_test.cpp.

References dismec::model::Model::is_partial_model(), dismec::model::Model::labels_begin(), dismec::model::Model::labels_end(), dismec::model::Model::num_labels(), and dismec::model::Model::num_weights().

◆ TEST_CASE() [5/6]

TEST_CASE ( "predict_scores checks"  )
Test:
This test verifies that Model::predict_scores() throws errors if the matrices have wrong shapes

Definition at line 79 of file dense_test.cpp.

◆ TEST_CASE() [6/6]

TEST_CASE ( "set dense weights errors"  )
Test:
We check the that the following result in an exception when setting the label weights:
  • supplying a target vector of non-matching size
  • accessing an invalid label

Definition at line 43 of file dense_test.cpp.