-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
Bug Report for https://neetcode.io/problems/handwritten-digit-classifier
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
I applied this code and it marked it as wrong answer:
class Solution(nn.Module):
def init(self):
super().init()
torch.manual_seed(0)
# flatten the image to 1d vector
# self.flatten = nn.Flatten()
self.first = nn.Linear((28*28),512)
self.second = nn.ReLU()
self.third = nn.Dropout(p=0.2)
self.fourth = nn.Linear(512,10)
self.final = nn.Sigmoid()
# Define the architecture here
def forward(self, images: TensorType[float]) -> TensorType[float]:
torch.manual_seed(0)
# x = self.flatten(images)
x = self.first(images) # linear projection
x = self.second(x) # ReLU
x = self.third(x) # Dropout
x = self.fourth(x) # logits (shape: batch × 10)
x = self.final(x) # probabilities
return torch.round(x, decimals=4)
# Return the model's prediction to 4 decimal places
But when I commented out and applied the solution it still marked it as wrong
Metadata
Metadata
Assignees
Labels
No labels