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.
Did you get a chance to try nasnet on dog breed?
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.
The definition of
TTA() has changed - the notebooks have been updated to show the new usage.
i’m sorry,please spare me i was not able to follow you on your comment,
but i tried this approach this time
but results were same
Double check this line…
sorry, i didn’t get you
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.
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…
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.
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…
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 ?
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
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?
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)
@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 I know this because I started as a complete beginner (to DL and programming) just 1 year ago myself…
After downloading the data into aws instance from kaggle how to group the images into according to their classes.
- to use
from_csvmethod - 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 -
- bash -
mv path/where/your/file/is.jpg path/where/you/want/your/file/to/be.jpg
- python -
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