neural network
A computational model inspired by biological neurons. Consists of layers of interconnected nodes that learn representations from data via backpropagation.
Syntax
ai-fundamentals
Input Layer -> Hidden Layers -> Output Layer
output = activation(weights * input + bias)Example
ai-fundamentals
# Simple neural network with PyTorch:
import torch.nn as nn
class MLP(nn.Module):
def __init__(self):
super().__init__()
self.layers = nn.Sequential(
nn.Linear(784, 256),
nn.ReLU(),
nn.Linear(256, 10)
)
def forward(self, x):
return self.layers(x)