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_sigmoid_loss_layer.h
6 : * @date 24 June 2021
7 : * @brief This is Cross Entropy Sigmoid with Sigmoid 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_SIGMOID_LOSS_LAYER_H__
16 : #define __CROSS_ENTROPY_SIGMOID_LOSS_LAYER_H__
17 : #ifdef __cplusplus
18 :
19 : #include <loss_layer.h>
20 :
21 : namespace nntrainer {
22 :
23 : /**
24 : * @class CrossEntropySigmoidLossLayer
25 : * @brief Cross Entropy Sigmoid Loss Layer
26 : */
27 : class CrossEntropySigmoidLossLayer : public LossLayer {
28 : public:
29 : /**
30 : * @brief Constructor of Cross Entropy Sigmoid Loss Layer
31 : */
32 39 : CrossEntropySigmoidLossLayer() : LossLayer() {}
33 :
34 : /**
35 : * @brief Destructor of Cross Entropy Sigmoid Loss Layer
36 : */
37 39 : ~CrossEntropySigmoidLossLayer() = 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 326 : const std::string getType() const override {
53 326 : return CrossEntropySigmoidLossLayer::type;
54 : };
55 :
56 : static constexpr const char *type = "cross_sigmoid";
57 : };
58 : } // namespace nntrainer
59 :
60 : #endif /* __cplusplus */
61 : #endif /* __CROSS_ENTROPY_SIGMOID_LOSS_LAYER_H__ */
|