Exemple #1
0
inline void ActFunc::tanh(MatD& x){
  x = x.array().tanh();
}
Exemple #2
0
//f'(x) = f(x)(1-f(x))
inline MatD ActFunc::logisticPrime(const MatD& x){
  return x.array()*(1.0-x.array());
}
Exemple #3
0
 inline double cosDis(const MatD& a, const MatD& b){
   return (a.array()*b.array()).sum()/(a.norm()*b.norm());
   //return a.col(0).dot(b.col(0))/(a.norm()*b.norm());
 }
Exemple #4
0
//f'(x) = 1-(f(x))^2
inline MatD ActFunc::tanhPrime(const MatD& x){
  return 1.0-x.array().square();
}