Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created September 21, 2020 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/2d0a27104834e06d74e83aa9c1425487 to your computer and use it in GitHub Desktop.
Save amankharwal/2d0a27104834e06d74e83aa9c1425487 to your computer and use it in GitHub Desktop.
# 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