示例#1
0
inline void ActFunc::tanh(MatD& x){
  x = x.array().tanh();
}
示例#2
0
//f'(x) = f(x)(1-f(x))
inline MatD ActFunc::logisticPrime(const MatD& x){
  return x.array()*(1.0-x.array());
}
示例#3
0
文件: Utils.hpp 项目: yehaibuaa/N3LP
 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());
 }
示例#4
0
//f'(x) = 1-(f(x))^2
inline MatD ActFunc::tanhPrime(const MatD& x){
  return 1.0-x.array().square();
}