Lesson 2 discussion

You are looking at the training loss, which is an average over the epoch (while the weights are changing).

If you add validation data to fit, the validation loss will also be computed at each epoch, but at the end of the epoch. The validation loss of the last epoch should be identical to what you get when running evaluate on the validation data.

Thank you @DBCerigo so much for summarizing. Very helpful. :clap:

Hi @jeremy , I have tensorflow running on my GPU. How do I make the utils.py run on my system, as it contains some theano imports.

Thanks,
Pradyumna

Hello,

First of all fantastic course. Thank you for sharing it to all.

I was trying to make predictions from test data after i retrain a couple of convolutional layers as mentioned at the end of lesson 2 notes. But i notice that this
test_path = 'data/redux/test/' test_data = get_batches(test_path)
is not detecting any images in the test folder at all. I checked on command line & there are test images in that folder. And the path provided is accurate. Snapshot of result attached.

Please let me know what i am missing here?

Also, just for clarification, once i get the test predictions, is this inclusive of the finetune() that vgg(16.py) has or should i be doing that separately for this model?

Can you run %pwd in a cell to see where you are? I suspect it’s because you are using a relative link (one that doesn’t start with a slash)

I know this is a little “late to the party”, but just in case, for those going through Lesson 2 and having the same memory issues, I have rewritten that particular section of the notebook using predict_generator(). This avoids loading all the images in memory to run the predictions.

You can always check the README.md for why I went this route.

HTH.

yes, spot on. Thanks alot.

I implemented the keras 2 version of cats vs dogs redux. It seems to be working OK but only getting ~89% accuracy max. I previously got the keras 1 version to 97% accuracy. Any ideas why I woudl get different results?
The Keras 2 is using the same weight files as 1.0.
Anyone getting Keras 2 to work with high accuracy? Which weights did you use?

Thanks

Jon

Hi Jeremy,

A question about the operation of Jupyter notebook.

Near the end of the first part,
I noticed you can hide the content below a header and later on you can expand it.
How did you do that, what did you type?

Thanks.

Hi, I have two questions about the linear model example at the beginning of the Lesson 2 notebook.

  1. Why doesn’t the loss estimate of the last fit iteration match the loss of the evaluated model? I think this must be because the loss is calculated slightly differently, but it’s not obvious to me from the documentation how this could be. Or maybe it is because of dropout? [edit: found answer to this one above]

  2. Why don’t the parameter estimates have a similar level of accuracy as the loss estimate? For how small the loss estimate is I would expect the parameters estimates to maybe not be exactly correct, but much closer than they are. For example, after 10 fit iterations my parameter estimates are off by ~0.005, while my loss is ~e-6. My guess is that the way the loss is calculated averages across the error induced by the parameter estimation errors and thus is reduced.

Many thanks

Hi All,

Sorry but I am getting the below error while trying to open lesson1 notebook

Unreadable Notebook: /home/ubuntu/lesson1.ipynb NotJSONError('Notebook does not appear to be JSON: ‘\n\n\n …’,)

Looks like the file is getting downloaded as HTML.

Can anybody please advise ?

I went to https://github.com/fastai/courses , then clicked “clone or download”, and “download ZIP”.

Thanks so much !! It worked.

restarting jupyter notebook is not required; just restart the kernal of that open notebook from the Kernal menu.

Oh yea! , thanks its SGD , I forgot , was considering full batch gradient descent, thanks!

So why should we use a lower learning rate if training more layers?

I believe it is so that we don’t overstep our move down via SGD.

We are dealing with an already pretty good fitted model. If the learning rate is too big, we could be jumping around in our path downwards which could mean that our results get worse. A smaller learning rate recognizes we are pretty close to a good solution and tells SGD to take little steps, thus mitigating that problem.

A question about the operation of Jupyter notebook.

Near the end of the first part of the video,
I noticed you can hide the content below a header and later on you can expand it.
How did you do that, what did you type?

try type ‘o’

nothing happens after typing ‘o’.