Skip to content
RED SAG Skills
hardStudy question · answer published in PyTorch interview questions, so no pointsdeep-learningpytorchdebugging

Layers in a plain Python list

In this model, the optimizer never updates the hidden layers. Why?

class Net(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = [nn.Linear(64, 64) for _ in range(4)]
        self.out = nn.Linear(64, 1)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions