mlpack  3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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);
59 
71  template<typename eT>
72  void Backward(const arma::Mat<eT>& input,
73  const arma::Mat<eT>& target,
74  arma::Mat<eT>& output);
75 
77  OutputDataType& OutputParameter() const { return outputParameter; }
79  OutputDataType& OutputParameter() { return outputParameter; }
80 
82  OutputDataType& Delta() const { return delta; }
84  OutputDataType& Delta() { return delta; }
85 
89  template<typename Archive>
90  void serialize(Archive& /* ar */, const unsigned int /* version */);
91 
92  private:
94  size_t inSize;
95 
97  OutputLayerType outputLayer;
98 
100  OutputDataType delta;
101 
103  OutputDataType outputParameter;
104 }; // class ConcatPerformance
105 
106 } // namespace ann
107 } // namespace mlpack
108 
109 // Include implementation.
110 #include "concat_performance_impl.hpp"
111 
112 #endif
double Forward(const arma::Mat< eT > &input, arma::Mat< eT > &target)
The core includes that mlpack expects; standard C++ includes and Armadillo.
ConcatPerformance(const size_t inSize=0, OutputLayerType &&outputLayer=OutputLayerType())
Create the ConcatPerformance object.
Implementation of the concat performance class.
OutputDataType & Delta()
Modify the delta.
OutputDataType & OutputParameter()
Modify the output parameter.
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.
OutputDataType & Delta() const
Get the delta.
void serialize(Archive &, const unsigned int)
Serialize the layer.