[][src]Function deep_learning_playground::perceptron::single::step_function

pub fn step_function<T: Float>(val: T) -> bool

step_function is the kind of activation functions. That is \[ \text{step}(x) = \begin{cases} 1 & (x\gt 0) \\ 0 & (\text{otherwise}) \end{cases} \] where \(x\in\mathbb{R}\).

e.g.

assert_eq!(true, deep_learning_playground::perceptron::single::step_function(0.1));
assert_eq!(false, deep_learning_playground::perceptron::single::step_function(-0.1));