13 #ifndef MLPACK_METHODS_ANN_LAYER_MULTIPLY_CONSTANT_IMPL_HPP 14 #define MLPACK_METHODS_ANN_LAYER_MULTIPLY_CONSTANT_IMPL_HPP 22 template<
typename InputDataType,
typename OutputDataType>
24 const double scalar) : scalar(scalar)
29 template<
typename InputDataType,
typename OutputDataType>
37 template<
typename InputDataType,
typename OutputDataType>
40 scalar(
std::move(layer.scalar))
45 template<
typename InputDataType,
typename OutputDataType>
52 scalar = layer.scalar;
57 template<
typename InputDataType,
typename OutputDataType>
64 scalar = std::move(layer.scalar);
69 template<
typename InputDataType,
typename OutputDataType>
70 template<
typename InputType,
typename OutputType>
72 const InputType& input, OutputType& output)
74 output = input * scalar;
77 template<
typename InputDataType,
typename OutputDataType>
78 template<
typename DataType>
80 const DataType& ,
const DataType& gy, DataType& g)
85 template<
typename InputDataType,
typename OutputDataType>
86 template<
typename Archive>
88 Archive& ar,
const uint32_t )
90 ar(CEREAL_NVP(scalar));
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
Definition: pointer_wrapper.hpp:23
void Backward(const DataType &, const DataType &gy, DataType &g)
Ordinary feed backward pass of a neural network.
Definition: multiply_constant_impl.hpp:79
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: multiply_constant_impl.hpp:87
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network.
Definition: multiply_constant_impl.hpp:71
Implementation of the multiply constant layer.
Definition: multiply_constant.hpp:34
MultiplyConstant & operator=(const MultiplyConstant &layer)
Copy assignment operator.
Definition: multiply_constant_impl.hpp:47
MultiplyConstant(const double scalar=1.0)
Create the MultiplyConstant object.
Definition: multiply_constant_impl.hpp:23