LCOV - code coverage report
Current view: top level - nntrainer/layers/loss - cross_entropy_softmax_loss_layer.h (source / functions) Coverage Total Hit
Test: coverage_filtered.info Lines: 100.0 % 4 4
Test Date: 2025-12-14 20:38:17 Functions: 66.7 % 3 2

            Line data    Source code
       1              : // SPDX-License-Identifier: Apache-2.0
       2              : /**
       3              :  * Copyright (C) 2021 Parichay Kapoor <pk.kapoor@samsung.com>
       4              :  *
       5              :  * @file   cross_entropy_Softmax_loss_layer.h
       6              :  * @date   24 June 2021
       7              :  * @brief  This is Cross Entropy Softmax with Softmax Loss Layer Class of Neural
       8              :  * Network
       9              :  * @see    https://github.com/nnstreamer/nntrainer
      10              :  * @author Parichay Kapoor <pk.kapoor@samsung.com>
      11              :  * @bug    No known bugs except for NYI items
      12              :  *
      13              :  */
      14              : 
      15              : #ifndef __CROSS_ENTROPY_SOFTMAX_LOSS_LAYER_H__
      16              : #define __CROSS_ENTROPY_SOFTMAX_LOSS_LAYER_H__
      17              : #ifdef __cplusplus
      18              : 
      19              : #include <loss_layer.h>
      20              : 
      21              : namespace nntrainer {
      22              : 
      23              : /**
      24              :  * @class   CrossEntropySoftmaxLossLayer
      25              :  * @brief   Cross Entropy Softmax Loss Layer
      26              :  */
      27              : class CrossEntropySoftmaxLossLayer : public LossLayer {
      28              : public:
      29              :   /**S
      30              :    * @brief     Constructor of Cross Entropy Softmax Loss Layer
      31              :    */
      32          204 :   CrossEntropySoftmaxLossLayer() : LossLayer() {}
      33              : 
      34              :   /**
      35              :    * @brief     Destructor of Cross Entropy Softmax Loss Layer
      36              :    */
      37          204 :   ~CrossEntropySoftmaxLossLayer() = default;
      38              : 
      39              :   /**
      40              :    * @copydoc Layer::forwarding(RunLayerContext &context, bool training)
      41              :    */
      42              :   void forwarding(RunLayerContext &context, bool training) override;
      43              : 
      44              :   /**
      45              :    * @copydoc Layer::calcDerivative(RunLayerContext &context)
      46              :    */
      47              :   void calcDerivative(RunLayerContext &context) override;
      48              : 
      49              :   /**
      50              :    * @copydoc Layer::getType()
      51              :    */
      52         3370 :   const std::string getType() const override {
      53         3370 :     return CrossEntropySoftmaxLossLayer::type;
      54              :   };
      55              : 
      56              :   static constexpr const char *type = "cross_softmax";
      57              : };
      58              : } // namespace nntrainer
      59              : 
      60              : #endif /* __cplusplus */
      61              : #endif /* __CROSS_ENTROPY_SOFTMAX_LOSS_LAYER_H__ */
        

Generated by: LCOV version 2.0-1