LCOV - code coverage report
Current view: top level - ml - Dense.cpp (source / functions) Hit Total Coverage
Test: test_coverage.info.cleaned Lines: 13 13 100.0 %
Date: 2022-07-06 02:47:47 Functions: 3 3 100.0 %

          Line data    Source code
       1             : #include "Dense.h"
       2             : 
       3             : namespace elsa::ml
       4             : {
       5             :     template <typename data_t>
       6           1 :     Dense<data_t>::Dense(index_t units, Activation activation, bool useBias,
       7             :                          Initializer kernelInitializer, Initializer biasInitializer,
       8             :                          const std::string& name)
       9             :         : Trainable<data_t>(LayerType::Dense, activation, useBias, kernelInitializer,
      10             :                             biasInitializer, name, /* required number of input dims */ 1),
      11           1 :           units_(units)
      12             :     {
      13           1 :     }
      14             : 
      15             :     template <typename data_t>
      16           2 :     index_t Dense<data_t>::getNumberOfUnits() const
      17             :     {
      18           2 :         return units_;
      19             :     }
      20             : 
      21             :     template <typename data_t>
      22           1 :     void Dense<data_t>::computeOutputDescriptor()
      23             :     {
      24           1 :         IndexVector_t dims(1);
      25           1 :         dims << units_;
      26           1 :         this->outputDescriptor_ = VolumeDescriptor(dims).clone();
      27             : 
      28           1 :         this->numberOfTrainableParameters_ =
      29           2 :             units_ * this->getInputDescriptor().getNumberOfCoefficients()
      30           1 :             + (this->useBias_ ? units_ : 0);
      31           1 :     }
      32             : 
      33             :     template class Dense<float>;
      34             : } // namespace elsa::ml

Generated by: LCOV version 1.15