Skip to content

Instantly share code, notes, and snippets.

Created Sep 21, 2020
What would you like to do?
# Prediction Algorithm
def predict_single(input, target, model):
inputs = input.unsqueeze(0)
predictions = model(inputs) # fill this
prediction = predictions[0].detach()
print("Input:", input)
print("Target:", target)
print("Prediction:", prediction)
# Testing the model with some samples
input, target = val_ds[0]
predict_single(input, target, model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment