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 mse_loss_layer.h
6 : * @date 24 June 2021
7 : * @brief This is MSE Loss Layer Class of Neural Network
8 : * @see https://github.com/nnstreamer/nntrainer
9 : * @author Parichay Kapoor <pk.kapoor@samsung.com>
10 : * @bug No known bugs except for NYI items
11 : *
12 : */
13 :
14 : #ifndef __MSE_LOSS_LAYER_H__
15 : #define __MSE_LOSS_LAYER_H__
16 : #ifdef __cplusplus
17 :
18 : #include <loss_layer.h>
19 :
20 : namespace nntrainer {
21 :
22 : /**
23 : * @class MSELossLayer
24 : * @brief MSE Loss Layer
25 : */
26 : class MSELossLayer : public LossLayer {
27 : public:
28 : /**
29 : * @brief Constructor of MSE Loss Layer
30 : */
31 461 : MSELossLayer() : LossLayer() {}
32 :
33 : /**
34 : * @brief Destructor of MSE Loss Layer
35 : */
36 461 : ~MSELossLayer() = default;
37 :
38 : /**
39 : * @copydoc Layer::forwarding(RunLayerContext &context, bool training)
40 : */
41 : void forwarding(RunLayerContext &context, bool training) override;
42 :
43 : /**
44 : * @copydoc Layer::calcDerivative(RunLayerContext &context)
45 : */
46 : void calcDerivative(RunLayerContext &context) override;
47 :
48 : /**
49 : * @copydoc Layer::getType()
50 : */
51 8470 : const std::string getType() const override { return MSELossLayer::type; };
52 :
53 : static constexpr const char *type = "mse";
54 : };
55 : } // namespace nntrainer
56 :
57 : #endif /* __cplusplus */
58 : #endif /* __MSE_LOSS_LAYER_H__ */
|