def accuracy(out, yb): preds = torch.argmax(out, dim=1) return (preds == yb).float().mean()