27 #ifndef MLPACK_METHODS_ANN_INIT_RULES_OIVS_INIT_HPP 28 #define MLPACK_METHODS_ANN_INIT_RULES_OIVS_INIT_HPP 57 class ActivationFunction = LogisticFunction
71 const double gamma = 0.9) :
73 b(
std::abs(ActivationFunction::inv(1 - epsilon) -
74 ActivationFunction::inv(epsilon)))
86 void Initialize(arma::Mat<eT>& W,
const size_t rows,
const size_t cols)
91 W = (
b / (
k * rows)) * arma::sqrt(W + 1);
103 template<
typename eT>
109 W = arma::Cube<eT>(rows, cols, slices);
111 for (
size_t i = 0; i < slices; i++)
Linear algebra utility functions, generally performed on matrices or vectors.
This class is used to initialize randomly the weight matrix.
The core includes that mlpack expects; standard C++ includes and Armadillo.
This class is used to initialize the weight matrix with the oivs method.
void Initialize(arma::Mat< eT > &W, const size_t rows, const size_t cols)
Initialize the elements of the specified weight matrix with the oivs method.
void Initialize(arma::Cube< eT > &W, const size_t rows, const size_t cols, const size_t slices)
Initialize the elements of the specified weight 3rd order tensor with the oivs method.
const double gamma
Parameter to define the uniform random range.
const double b
Parameter to control the activation region.
const int k
Parameter to control the activation region width.
OivsInitialization(const double epsilon=0.1, const int k=5, const double gamma=0.9)
Initialize the random initialization rule with the given values.
void Initialize(arma::Mat< eT > &W, const size_t rows, const size_t cols)
Initialize randomly the elements of the specified weight matrix.