Dog Breed Identification challenge


(sergii makarevych) #325

This was in notebook example shared by Jeremy. Because I was using nasnet and resnext for Dog breeds, I noticed the difference. Simple as that.


(Eric Perbos-Brinck) #326

.
:cowboy_hat_face:


(Ankit Goila) #327

Did you get a chance to try nasnet on dog breed?


(Eric Perbos-Brinck) #328

No, I didn’t have the time to fix the code for NasNet and focused on starting the Seedlings competition instead, I’d like to test a few things out before the DHS-TSA competition first round ends.


(naveen manwani) #329

facing this issue ,does anybody know how to resolve it


(Jeremy Howard) #330

The definition of TTA() has changed - the notebooks have been updated to show the new usage.


(naveen manwani) #331

i’m sorry,please spare me i was not able to follow you on your comment,
but i tried this approach this time
log_preds,y=learn.TTA(n_aug=4, is_test=False)
probs=np.mean(np.exp(log_preds),0)
accuracy(log_preds,y), metrics.log_loss(y,probs)
but results were same


(James Requa) #332

Double check this line…


(naveen manwani) #333

sorry, i didn’t get you


(naveen manwani) #334

could anyone exactly point out which part of my code is wrong and the immediate step i should take to correct my code
please i’m newbie in this domain.


(Aditya) #335

Hi @naveenmanwani,

Just wanted to tell you something which I learnt beacuse of THE amazingly awesome people in this forum,

It’s high time to give up your fear at looking the code which just works out of the box and understanding it in pieces and then connecting the dots…
I had got rid of that fear because of this Forum

So if I can, anyone can…


(Aditya) #336
def TTA(self, n_aug=4, is_test=False):
        Args:
            n_aug: a number of augmentation images to use per original image
            is_test: indicate to use test images; otherwise use validation images
        Returns:
            (tuple): a tuple containing:
                log predictions (numpy.ndarray): log predictions (i.e. `np.exp(log_preds)` will return probabilities)
                targs (numpy.ndarray): target values when `is_test==False`; zeros otherwise.

So log_preds variable contains the log prediction.
y variable contains the target values in your case.

Accuracy Code

def accuracy(preds, targs):
    preds = np.argmax(preds, axis=1)
    return (preds==targs).mean()

And this one is from sklearn


def log_loss(y_true, y_pred, eps=1e-15, normalize=True, sample_weight=None,
             labels=None):
    Parameters
    ----------
    y_true : array-like or label indicator matrix
        Ground truth (correct) labels for n_samples samples.
    y_pred : array-like of float, shape = (n_samples, n_classes) or (n_samples,)
        Predicted probabilities, as returned by a classifier
    `Returns
    -------
    loss : float

Hope it helps now…


(Kumar Shridhar) #337

Hey guys,
How is there suddenly a lot of guys in top 20 of dog breed identification challenge ? Some people even jumped 300+ places. Any ideas how in last 2-3 days so many people are jumping so high ?


(naveen manwani) #338

well,i try my level best in doing or rather implementing what you have advice me to do.and i relly appreciate your effort in putting these scripts for me
so ,if i understood you correctly may be i’m wrong in line 3 for putting accuracy(log_preds,y), metrics.log_loss(y,probs)
because i’m already doing mean of the log_preds .
so ,i should remove accuracy from the last line


(Aditya) #339

Well let’s reveal the answer as per as I know,

accuracy(probs,y)
is the correct version to call
Can someone just confirm?

@jamesrequa(sorry for @) but is it correct now?


(naveen manwani) #340

sorry my bad because i was overlooking something i converted this small problem into a big one
jeremy clearly mentioned the definition of TTA() has been updated .so change things accordingly
in the first notebook accuracy was(log_preds,y)
but in the updated notebook it is accuracy(probs, y)


(James Requa) #342

Yes!

@naveenmanwani Sorry I didn’t tell you directly the answer only told you where to look, I think you can learn much better once you “discover” the solution on your own! Like @ecdrid suggested the more you look at the code and write code the more it will all start to make sense :slight_smile: I know this because I started as a complete beginner (to DL and programming) just 1 year ago myself…


(Nandamuri Hari Naga Sumanth) #344

After downloading the data into aws instance from kaggle how to group the images into according to their classes.


(sergii makarevych) #345
  • to use from_csv method - it assumes you have all data in a single folder
  • if you still need to move your stuff around bash scripting is your friend. take a look at these commands and if you got stuck let us know:
    • python - os.system
    • bash - mv path/where/your/file/is.jpg path/where/you/want/your/file/to/be.jpg

(naveen manwani) #346

finally after troubling you all with silly question .i did my submission though i got 80 rank which i know way low according to the standard which is set by you all.but i’m happy and now after my first submission i have become more greedy.so i’ll to make it better
image