human
Solve the following python programming problem given the following code:
# Our code from above
class LogReg(nn.Module):
    def __init__(self):
        super().__init__()
        self.l1_w = get_weights(28*28, 10)  # Layer 1 weights
        self.l1_b = get_weights(10)         # Layer 1 bias

    def forward(self, x):
        x = x.view(x.size(0), -1)
        x = x @ self.l1_w + self.l1_b 
        return torch.log(softmax(x))

net2 = LogReg().cuda()
opt=optim.Adam(net2.parameters())

fit(net2, md, epochs=1, crit=loss, opt=opt, metrics=metrics)
Given the above code, generate some markdown instructions for it.
assistant
#Here is the Python code you requested.

Writing Our Own Training Loop
As a reminder, this is what we did above to write our own logistic regression class (as a pytorch neural net):