Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Integrate Dropout and BatchNorm | Regularization Techniques
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Optimization and Regularization in Neural Networks with Python

bookChallenge: Integrate Dropout and BatchNorm

Tarefa

Swipe to start coding

You will extend a simple neural network by integrating Dropout and Batch Normalization. Your goal is to correctly insert these layers into the architecture and perform a forward pass.

You are given:

  • Input batch x
  • A partially defined network class
  • A forward method missing some components

Complete the following steps:

  1. Add a Dropout layer after the first fully connected layer.

  2. Add a BatchNorm layer immediately after Dropout.

  3. Complete the forward pass so that the data flows through:

    • Linear → ReLU → Dropout → BatchNorm → Linear
  4. Ensure Dropout is used only during training (PyTorch handles this automatically).

After execution, the script prints the network output.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 5
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain this in simpler terms?

What are the main benefits or drawbacks?

Can you give me a real-world example?

close

bookChallenge: Integrate Dropout and BatchNorm

Deslize para mostrar o menu

Tarefa

Swipe to start coding

You will extend a simple neural network by integrating Dropout and Batch Normalization. Your goal is to correctly insert these layers into the architecture and perform a forward pass.

You are given:

  • Input batch x
  • A partially defined network class
  • A forward method missing some components

Complete the following steps:

  1. Add a Dropout layer after the first fully connected layer.

  2. Add a BatchNorm layer immediately after Dropout.

  3. Complete the forward pass so that the data flows through:

    • Linear → ReLU → Dropout → BatchNorm → Linear
  4. Ensure Dropout is used only during training (PyTorch handles this automatically).

After execution, the script prints the network output.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 5
single

single

some-alt