Created
May 30, 2019 15:40
-
-
Save khuangaf/ea628505838ebffb3a82286be5368969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def evaluate(loader): | |
model.eval() | |
predictions = [] | |
labels = [] | |
with torch.no_grad(): | |
for data in loader: | |
data = data.to(device) | |
pred = model(data).detach().cpu().numpy() | |
label = data.y.detach().cpu().numpy() | |
predictions.append(pred) | |
labels.append(label) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment