Learning Guy

Beginner

EthicsAI Policy

AI Ethics and Safety

A critical look at the ethical implications of AI deployment and safety guidelines.

Course Completion

0%

The Perceptron

The perceptron is one of the simplest artificial neural networks. It was invented in 1957 by Frank Rosenblatt at the Cornell Aeronautical Laboratory. Despite its simplicity, the perceptron is a fundamental building block for more complex neural networks and serves as an excellent introduction to the core concepts of machine learning.

A perceptron takes several binary inputs, x₁, x₂, ..., and produces a single binary output. Rosenblatt proposed a simple rule to compute the output. He introduced weights, w₁, w₂, ..., real numbers expressing the importance of the respective inputs to the output.

How It Works

The neuron's output, 0 or 1, is determined by whether the weighted sum ∑ⱼwⱼxⱼ is less than or greater than some threshold value. Just like the weights, the threshold is a real number which is a parameter of the neuron.

def perceptron(inputs, weights, threshold):
    weighted_sum = sum(x * w for x, w in zip(inputs, weights))
    return 1 if weighted_sum > threshold else 0

# Example usage
inputs = [0, 1, 1, 0]
weights = [0.5, 0.2, 0.3, -0.1]
threshold = 0.5
output = perceptron(inputs, weights, threshold)
print(f"Perceptron output: {output}")

This simple mechanism allows a perceptron to make decisions. By adjusting the weights and the threshold, we can create different decision-making models.