Free course · Lesson 3 of 5
Neural Networks & Deep Learning
In this lesson you will
- Describe neural networks in simple terms
- Explain how chat assistants generate text
A neural network is a computing system inspired by the human brain. It consists of layers of interconnected "neurons" that process information. Deep Learning uses neural networks with many layers (hence "deep") to handle complex tasks like image recognition, speech translation, and natural language understanding.
- Input layer: receives the raw data (e.g., pixel values of an image).
- Hidden layers: extract patterns — edges, shapes, objects — layer by layer.
- Output layer: produces the final prediction (e.g., "cat" or "dog").
- Popular deep learning frameworks: TensorFlow (Google) and PyTorch (Meta).
💡 Practical Skill: Use TensorFlow Playground (online tool) to visually experiment with neural networks. No code needed — just drag layers and see how the network learns patterns.
# A minimal neural network using TensorFlow (Keras)# Install: pip install tensorflow import tensorflow as tfimport numpy as np # Simple dataset: learn the XOR logic gate# Input: [0,0], [0,1], [1,0], [1,1]# Output: 0, 1, 1, 0inputs = np.array([[0,0], [0,1], [1,0], [1,1]], dtype=float)outputs = np.array([[0], [1], [1], [0]], dtype=float) # Build the neural networkmodel = tf.keras.Sequential([ tf.keras.layers.Dense(4, activation='relu', input_shape=(2,)), tf.keras.layers.Dense(1, activation='sigmoid')]) # Compile the modelmodel.compile(optimizer='adam', loss='mse') # Train the modelprint("Training the neural network...")model.fit(inputs, outputs, epochs=500, verbose=0)print("Training complete!") # Test predictionspredictions = model.predict(inputs, verbose=0)for i, inp in enumerate(inputs): print(f"Input: {inp} => Predicted: {predictions[i][0]:.4f} (expected: {outputs[i][0]})")
Practice exercise
Ask a chat assistant a question about your town that you know the answer to, and check whether its answer is correct.
Key takeaways
- Neural networks learn by adjusting many weights
- Chat assistants predict text one piece at a time
- Fluent answers can still be false
Free self-study lesson — no certificate. For the full instructor-led program, see registration options.