12 #ifndef MLPACK_METHODS_ANN_LAYER_SELECT_IMPL_HPP 13 #define MLPACK_METHODS_ANN_LAYER_SELECT_IMPL_HPP 21 template<
typename InputDataType,
typename OutputDataType>
24 const size_t elements) :
31 template<
typename InputDataType,
typename OutputDataType>
34 const arma::Mat<eT>& input, arma::Mat<eT>& output)
38 output = input.col(index);
42 output = input.submat(0, index, elements - 1, index);
46 template<
typename InputDataType,
typename OutputDataType>
49 const arma::Mat<eT>& ,
50 const arma::Mat<eT>& gy,
59 g = gy.submat(0, 0, elements - 1, 0);
63 template<
typename InputDataType,
typename OutputDataType>
64 template<
typename Archive>
66 Archive& ar,
const uint32_t )
68 ar(CEREAL_NVP(index));
69 ar(CEREAL_NVP(elements));
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
Definition: select_impl.hpp:48
Select(const size_t index=0, const size_t elements=0)
Create the Select object.
Definition: select_impl.hpp:22
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: select_impl.hpp:65
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
Definition: select_impl.hpp:33