Skip to content
RED SAGSkills
hard20 pts · first answer countsdeep-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