Biological Neural Networks
Learn how biological neurons inspired the development of artificial neural networks.
Biology
Inspiration
Neurons
Biological neurons receive signals through dendrites, process them in the cell body, and transmit outputs through axons. This inspired the artificial neuron model with inputs, processing, and outputs.
Artificial Neuron Model
Understand the mathematical model that simulates biological neuron behavior.
y = f(∑(wᵢxᵢ) + b)
where f is activation function, w are weights, x are inputs, b is bias
import numpy as np
class ArtificialNeuron:
def __init__(self, num_inputs):
"""Initialize neuron with random weights and bias"""
self.weights = np.random.randn(num_inputs) * 0.01
self.bias = 0.0
def sigmoid(self, x):
"""Sigmoid activation function"""
return 1 / (1 + np.exp(-np.clip(x, -500, 500)))
def forward(self, inputs):
"""Forward pass: compute output"""
# Weighted sum of inputs
weighted_sum = np.dot(inputs, self.weights) + self.bias
# Apply activation function
output = self.sigmoid(weighted_sum)
return output
# Demonstrate artificial neuron
def demonstrate_neuron():
"""Show how an artificial neuron works"""
print("=== ARTIFICIAL NEURON DEMONSTRATION ===")
# Create neuron with 3 inputs
neuron = ArtificialNeuron(num_inputs=3)
# Show initial weights and bias
print(f"Initial weights: {neuron.weights}")
print(f"Initial bias: {neuron.bias}")
# Test inputs
test_inputs = [
[1.0, 0.5, -1.0],
[0.0, 1.0, 1.0],
[-1.0, 0.0, 0.5]
]
print("\\n=== NEURON RESPONSES ===")
for i, inputs in enumerate(test_inputs):
output = neuron.forward(np.array(inputs))
weighted_sum = np.dot(inputs, neuron.weights) + neuron.bias
print(f"\\nInput {i+1}: {inputs}")
print(f" Weighted sum: {weighted_sum:.3f}")
print(f" Output (after sigmoid): {output:.3f}")
demonstrate_neuron()
print("\\n=== NEURON COMPONENTS ===")
components = {
"Inputs (x)": "Data features fed to the neuron",
"Weights (w)": "Learned parameters controlling input importance",
"Bias (b)": "Learned offset parameter",
"Weighted Sum": "Linear combination: w₁x₁ + w₂x₂ + ... + b",
"Activation": "Non-linear function applied to weighted sum",
"Output (y)": "Final neuron response"
}
for component, description in components.items():
print(f"{component}: {description}")
Neural Network History
Explore the key milestones in neural network development from the 1940s to today.
1943: McCulloch-Pitts neuron model
1957: Perceptron algorithm
1969: Perceptron limitations identified
1986: Backpropagation algorithm
2006: Deep learning renaissance
2012: AlexNet breakthrough
# Neural network history timeline
nn_history = {
1943: {
"Event": "McCulloch-Pitts Neuron",
"Description": "First mathematical model of artificial neuron",
"Impact": "Foundation of neural computation"
},
1957: {
"Event": "Perceptron Algorithm",
"Description": "Frank Rosenblatt's learning algorithm",
"Impact": "First trainable neural network"
},
1969: {
"Event": "Perceptrons Book",
"Description": "Minsky & Papert show perceptron limitations",
"Impact": "First AI winter begins"
},
1986: {
"Event": "Backpropagation",
"Description": "Rumelhart, Hinton & Williams formalize backprop",
"Impact