def loss(self, model, criterion, X_batch, y_batch):
preds = model(X_batch.view(-1, 3, 84, 84).float().to(device))
loss = criterion(
preds.view(-1, 1).float().to(“cpu”).float(),
y_batch.view(-1, 1).float().to(“cpu”).float(),
)
loss = loss.item()
return loss