Calculation of loss for get_preds

(Dhanya Raghu) #1

I am trying to calculate the accuracy and loss for the test dataset. Since we dont have labels for our test dataset, what kind of loss does the “get_preds()” function return for the test dataset?

Thanks!

0 Likes

(Zachary Mueller) #2

The test set is pseudolabels, eg everything is 1. So the ‘loss’ isn’t really a thing you just care about the predictions.

Do you have labels beforehand? If so there’s a different way to go about it.

0 Likes

(Dhanya Raghu) #3

Thanks for the reply. I have the labels beforehand too. How do I go about that?
I have exported my learner as well. I need to add the test dataset with labels. Can you please help?

0 Likes

(Zachary Mueller) #4

Sure! Here’s a notebook link however if you need more guidance when I’m at a computer I can show code. Is it tabular or image.

0 Likes

(Dhanya Raghu) #5

I am using image dataset with classification labels. I’ll take a look and let you know!
Thanks!

0 Likes

(Zachary Mueller) #6

Sounds good :slight_smile: the above method works for images too.

1 Like

(Dhanya Raghu) #7

I also had another question. When I predict for a test img with labels and calculate the loss, I want to backprop this loss to the input image and calculate the total error at the input layer. What kind of parameters can I pass in “learn.backward(item)”? Is this the right way to go about this?

0 Likes

(Zachary Mueller) #8

That one I don’t quite know the answer to my apologies :confused: hopefully someone can chime in with that!

0 Likes

(Dhanya Raghu) #9

No worries :slight_smile:

0 Likes