neural_network.activation_functions.binary_step

This script demonstrates the implementation of the Binary Step function.

It’s an activation function in which the neuron is activated if the input is positive or 0, else it is deactivated

It’s a simple activation function which is mentioned in this wikipedia article: https://en.wikipedia.org/wiki/Activation_function

Functions

binary_step(→ numpy.ndarray)

Implements the binary step function

Module Contents

neural_network.activation_functions.binary_step.binary_step(vector: numpy.ndarray) numpy.ndarray

Implements the binary step function

Parameters:

vector (ndarray): A vector that consists of numeric values

Returns:

vector (ndarray): Input vector after applying binary step function

>>> vector = np.array([-1.2, 0, 2, 1.45, -3.7, 0.3])
>>> binary_step(vector)
array([0, 1, 1, 1, 0, 1])