Explain how neural networks learn. Focus on the backpropagation algorithm.
All blocks
Communication
Conversation Branch
Branching conversation UI with thread navigation, sibling switching, confidence indicators, and an optional minimap.
Studio+
Install command is available on Studio. Preview below is free for everyone.
Install with shadcn CLI
Adds the block files into your project. Run from an app that already has shadcn initialized.
Sign in to view the install command. Studio unlocks premium blocks.
Sign inPreview
Live demo of this block in the browser.
Conversation Branch
Branching thread UI for multi-path AI conversations with minimap navigation and confidence metrics.
Conversation Branch
Alternate response visualization
9
Messages
2
Alt. branches
88%
Avg confidence
6
Active depth
91% conf
Neural networks learn through a process called backpropagation. At its core, the network makes a prediction, calculates how wrong it was (the loss), and then adjusts every weight in reverse - from output back to input - to reduce that error.
What about vanishing gradients? How does that affect training deep networks?
2 alternates
94% conf
Vanishing gradients happen because we multiply many small numbers together. In deep networks using sigmoid activations, gradients shrink exponentially as they propagate backwards.
Can you give me a concrete PyTorch example of a training loop?
97% conf
Here's a minimal PyTorch training loop with Adam and cross-entropy loss.