Understanding the building blocks of AI through interactive examples and hands-on coding.
🧠 Try the DemoNeurons process inputs using weighted connections and apply activation functions.
Neural networks stack layers - input, hidden, and output - to learn complex patterns.
Optimization algorithms adjust weights to minimize prediction errors over time.
// Initialize network with brain.js
const net = new brain.NeuralNetwork();
// Train for XOR logic gate
net.train([
{input: [0,0], output: [0]},
{input: [0,1], output: [1]},
{input: [1,0], output: [1]},
{input: [1,1], output: [0]}
]);
// Test predictions
console.log('0,0 →', net.run([0,0]).toFixed(3));
console.log('0,1 →', net.run([0,1]).toFixed(3));
console.log('1,0 →', net.run([1,0]).toFixed(3));
console.log('1,1 →', net.run([1,1]).toFixed(3));
This simple network learns the XOR pattern through gradient descent optimization. The brain.js library handles weight updates automatically - try running the code!
Deep learning models process visual data with convolutional networks
Transformers power language models by understanding word context
Reinforcement learning builds agents that master complex environments