concat_performance.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_LAYER_CONCAT_PERFORMANCE_HPP
13 #define MLPACK_METHODS_ANN_LAYER_CONCAT_PERFORMANCE_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 #include "layer_types.hpp"
18 
19 namespace mlpack {
20 namespace ann {
21 
32 template <
33  typename OutputLayerType = NegativeLogLikelihood<>,
34  typename InputType = arma::mat,
35  typename OutputType = arma::mat
36 >
37 class ConcatPerformance : public Layer<InputType, OutputType>
38 {
39  public:
46  ConcatPerformance(OutputLayerType&& outputLayer = OutputLayerType());
47 
48  /*
49  * Computes the Negative log likelihood.
50  *
51  * @param input Input data used for evaluating the specified function.
52  * @param output Resulting output activation.
53  */
54  void Forward(const InputType& input, OutputType& target);
55 
67  void Backward(const InputType& input,
68  const OutputType& target,
69  OutputType& output);
70 
72  OutputType& OutputParameter() const { return outputParameter; }
74  OutputType& OutputParameter() { return outputParameter; }
75 
77  OutputType& Delta() const { return delta; }
79  OutputType& Delta() { return delta; }
80 
84  template<typename Archive>
85  void serialize(Archive& /* ar */, const uint32_t /* version */);
86 
87  private:
89  OutputLayerType outputLayer;
90 }; // class ConcatPerformance
91 
92 } // namespace ann
93 } // namespace mlpack
94 
95 // Include implementation.
96 #include "concat_performance_impl.hpp"
97 
98 #endif
void Backward(const InputType &input, const OutputType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputType & Delta()
Modify the delta.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Implementation of the concat performance class.
ConcatPerformance(OutputLayerType &&outputLayer=OutputLayerType())
Create the ConcatPerformance object.
OutputType & Delta() const
Get the delta.
void serialize(Archive &, const uint32_t)
Serialize the layer.
void Forward(const InputType &input, OutputType &target)
OutputType & OutputParameter() const
Get the output parameter.
A layer is an abstract class implementing common neural networks operations, such as convolution...
Definition: layer.hpp:52
OutputType & OutputParameter()
Modify the output parameter.