✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
The following function trains a neural network for one epoch. The body of the inner loop consists of 5 statements, listed below in scrambled order. Put them in the correct execution order (1. = first, 5.=last).
Ignore optimizer.zero_grad() and code indentation for this example.
def update(network: nn.Module, data: DataLoader, loss: nn.Module,optimizer:optim.Optimizer):