AI · Deep Learning · Computer Vision · Discriminative Models
OUTTA Basic — Neural Networks for Function Approximation and Nonlinear Classification
2026-08-01 · updated 2026-08-01 · Hyeongrok Ryu
I compared sigmoid-basis function approximation, spiral decision boundaries, and a stalled classifier to understand network capacity and training failure.
- Type / level
- study-note · beginner
- Tools
- Python, PyTorch, Matplotlib
A checkpoint in the study sequence for this note.
A checkpoint in the study sequence for this note.
A checkpoint in the study sequence for this note.
A checkpoint in the study sequence for this note.
Sigmoid as a basis
I stopped thinking of a network only as a neuron count and rewrote it as transformations followed by a weighted sum. The activation section in the 71-page neural-network module led me to compare how weights and biases shift the slope and position of each sigmoid.




The hidden-layer output became easier to connect to the figures when I wrote
ŷ(x) = Σⱼ vⱼσ(wⱼx + bⱼ) + c
Loss and backpropagation
I measured the distance between the approximation and target with mean squared error and propagated it to every parameter. The stored curve approaches zero near 2,000 epochs; I used the trend and oscillation rather than the epoch count alone.

Classifying spiral data
The three-class spiral made the need for hidden nonlinear layers visible. I passed logits, not softmax probabilities, to CrossEntropyLoss and printed the (batch, 3) output shape first. As training progressed, the boundary bent between the intertwined classes.






Reading a failed run
A second spiral experiment stayed near loss 1.10 and accuracy 1/3, the random level for three classes. I checked whether an activation was missing, whether labels used long, and whether the optimizer held the current model parameters.




Minimal classifier
model = torch.nn.Sequential(
torch.nn.Linear(2, 32),
torch.nn.Tanh(),
torch.nn.Linear(32, 32),
torch.nn.Tanh(),
torch.nn.Linear(32, 3),
)
logits = model(features)
assert logits.shape == (features.shape[0], 3)
loss = torch.nn.functional.cross_entropy(logits, labels.long())
Checks I kept
I read loss, accuracy, and the decision boundary together. If only one looked good, I returned to the model, labels, and split. The retained outputs cover both a useful nonlinear boundary and a stalled network, which made the contrast more instructive than a success-only summary.
Previous and next
Sources used
- Artificial Neural Networks — course-pdf; perceptrons, activations, and backpropagation