FCNN.cpp
// activation functions / error functions and their helpers

activation functions / error functions and their helpers
activation functions / error functions and their helpers
inline vec_t stable_softmax(const vec_t& ofWhat) {
	vec_t shifted = ofWhat - ofWhat.max();
	for (unsigned i = 0; i < shifted.size(); ++i) { shifted[i] = exp(shifted[i]); }
	shifted /= shifted.sum();
	return shifted;
}
inline vec_t stable_softmax ( const vec_t & ofWhat ) { vec_t shifted = ofWhat - ofWhat . max ( ) ; for ( unsigned i = 0 ; i < shifted . size ( ) ; ++ i ) { shifted [ i ] = exp ( shifted [ i ] ) ; } shifted /= shifted . sum ( ) ; return shifted ; }
activation functions / error functions and their helpers
activation functions / error functions and their helpers