Part 2 Lesson 14 Wiki


(Rohit Singh) #126

The normed parameter needs to be True above, as the predictions and targets would also have been normalized.

Here are a couple results of my attempt with super-resolution on satellite imagery… it’s amazing!

:

sat-superres-lanes

It’s looking like something out of ‘Enemy of the State’! :slight_smile:


(Arvind Nagaraj) #127

I was thinking the same!


(Rohit Singh) #128

My labeled data is not perfect, but the results of road detection on satellite imagery are surely encouraging. Imagine getting road networks for remote places in a snap without the costly digitization!


(Ravi Sekar Vijayakumar) #129

Next steps:


(Daniel Hunter) #130

Does anyone know what this line is doing in the carvana notebook?

learn.metrics=[accuracy_thresh(0.5)]

I checked the source code and I’m really confused:

def accuracy_thresh(thresh):
    return lambda preds,targs: accuracy_multi(preds, targs, thresh)

and then:

def accuracy_multi(preds, targs, thresh):
    return ((preds>thresh).float()==targs).float().mean()

what’s going on here? In accuracy_thresh(), where are the 2 arguments to the lambda function pred,targs, coming from? It appears to be comparing the predictions to the targets (but only the predictions above a certain threshold), but I can’t figure out how it’s actually working. Where is the info coming from? Are there some global variables or something I’m missing?

[EDIT]: Leaving this here for anyone who is also confused — I figured it out. It’s creating the function object and then returning it, and it’s used in fit().


(Even Oldridge) #131

Along the lines of the CSI enhance, and very similar to the work done in this lesson there’s a very impressive paper where they trained a net to produce an image with a longer exposure for low light photography.

https://arxiv.org/abs/1805.01934

Unfortunately no source code, but this could make for an interesting project.


(Sam) #132

In enhance.ipynb…in cell 16 next is supposed to get next batch from the dataloader

x,y = next(iter(md.val_dl))

in cell 17 idx=1, which I expected is the index relative to the batch and an image is shown.

However even if I run x,y = next(iter(md.val_dl)) say 4 times and then run cell 17 I see the same image.

This is not expected. Can someone run an experiment and confirm this to be the case?

Update: If I use md.trn_dl I do see a different image each time

Thank you all

Thanks to @kosborne this is resolved
It seems that iter(md.val_ld) creates a new iterator. To get the next batch one must code as:
my_iter = iter(md.val_dl) #execute only once)
x,y = next(my_iter)[idx] # execute multiple times to get idx-th image from the batch each time

Thank you all