#ifndef NEURAL_SLOPE_STD_H #define NEURAL_SLOPE_STD_H #include #include "neural/slope.h" namespace Neural { template sigtype tpltanh( sigtype sInput ); template<> float tpltanh( float sInput ) { return tanhf( sInput ); } template<> double tpltanh( double sInput ) { return tanh( sInput ); } template<> long double tpltanh( long double sInput ) { return tanhl( sInput ); } template class SlopeStd : public Slope { public: SlopeStd( sigtype sSlope=1.0 ) : sSlope( sSlope ) { } virtual ~SlopeStd() { } virtual sigtype operator()( sigtype sInput ) { return (tpltanh(2.0*sSlope*sInput) + 1.0)/2.0; } private: sigtype sSlope; }; }; #endif