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 <boost/ptr_container/ptr_vector.hpp>
18 
19 #include "layer_types.hpp"
20 
21 namespace mlpack {
22 namespace ann {
23 
34 template <
35  typename OutputLayerType = NegativeLogLikelihood<>,
36  typename InputDataType = arma::mat,
37  typename OutputDataType = arma::mat
38 >
40 {
41  public:
48  ConcatPerformance(const size_t inSize = 0,
49  OutputLayerType&& outputLayer = OutputLayerType());
50 
51  /*
52  * Computes the Negative log likelihood.
53  *
54  * @param input Input data used for evaluating the specified function.
55  * @param output Resulting output activation.
56  */
57  template<typename eT>
58  double Forward(const arma::Mat<eT>&& input, arma::Mat<eT>&& target);
70  template<typename eT>
71  void Backward(const arma::Mat<eT>&& input,
72  const arma::Mat<eT>&& target,
73  arma::Mat<eT>&& output);
74 
76  OutputDataType& OutputParameter() const { return outputParameter; }
78  OutputDataType& OutputParameter() { return outputParameter; }
79 
81  OutputDataType& Delta() const { return delta; }
83  OutputDataType& Delta() { return delta; }
84 
88  template<typename Archive>
89  void serialize(Archive& /* ar */, const unsigned int /* version */);
90 
91  private:
93  size_t inSize;
94 
96  OutputLayerType outputLayer;
97 
99  OutputDataType delta;
100 
102  OutputDataType outputParameter;
103 }; // class ConcatPerformance
104 
105 } // namespace ann
106 } // namespace mlpack
107 
108 // Include implementation.
109 #include "concat_performance_impl.hpp"
110 
111 #endif
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
ConcatPerformance(const size_t inSize=0, OutputLayerType &&outputLayer=OutputLayerType())
Create the ConcatPerformance object.
OutputDataType & Delta() const
Get the delta.
Implementation of the concat performance class.
OutputDataType & Delta()
Modify the delta.
OutputDataType & OutputParameter()
Modify the output parameter.
double Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&target)
void Backward(const arma::Mat< eT > &&input, const arma::Mat< eT > &&target, arma::Mat< eT > &&output)
Ordinary feed backward pass of a neural network.
OutputDataType & OutputParameter() const
Get the output parameter.
void serialize(Archive &, const unsigned int)
Serialize the layer.