4#include "../matrix_utils.h"
6double relu(
const double& in) {
return std::max(0.0, in); }
7double sigmoid(
const double& in) {
return 1.0 / (1.0 + exp(-in)); }
11 return in.
Apply([](
const double& a) {
return sigmoid(a); });
15 return (
double)
Corr(predictions, ground_truth) / predictions.
rows();
size_t rows() const
Definition: Matrix.h:193
Matrix< T > Apply(const std::function< T(T)> &fun) const
Definition: Matrix.h:375
double relu(const double &in)
Definition: utils.h:6
double accuracy(const Matrix< double > &predictions, const Matrix< double > &ground_truth)
Definition: utils.h:14
Matrix< double > Sigmoid(const Matrix< double > &in)
Definition: utils.h:9
double sigmoid(const double &in)
Definition: utils.h:7
size_t Corr(const Matrix< T > &A, const Matrix< T > &B)
Definition: matrix_utils.h:103