Artificial Intelligence course - Lesson 6 of 10

Lesson 6: Neural networks and deep learning

Learn AI fundamentals, data, machine learning, model evaluation, neural networks, generative AI, responsible deployment, and a practical capstone.

← All Artificial Intelligence lessons

Lesson 6 of 10

Neural networks and deep learning

A neural network is a model built from layers of connected computations. During training, it compares predictions with known answers and uses an optimization method such as gradient descent to adjust internal weights. Deep learning uses networks with many layers and is especially useful for complex patterns in images, audio, and language.

More layers or parameters do not automatically mean better results. Neural networks may need more data and compute, can be difficult to interpret, and can overfit by memorizing training examples. Begin with a simpler model when it solves the problem well.

# A simplified training loop
for batch in training_data:
    prediction = model(batch.inputs)
    loss = compare(prediction, batch.expected)
    optimizer.update(model.parameters, loss)

Try it: Explain why a model that performs very well on examples it has already seen may still perform poorly for new users.