text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png
from pathlib import Path

path = Path().cwd() / 'dogs'

dog = DataBlock(blocks=(ImageBlock, CategoryBlock), get_items=get_image_files, splitter=RandomSplitter(valid_pct=0.2, seed=42), get_y=parent_label, item_tfms=Resize(128))

dls = dog.dataloaders(path)

dog = dog.new(item_tfms=RandomResizedCrop(128, min_scale=0.5), batch_tfms=aug_transforms())
dls = dog.dataloaders(path)

learn = cnn_learner(dls, resnet18, metrics=error_rate)

lr_min, lr_steep, lr_slide, lr_valley = learn.lr_find(suggest_funcs=(minimum, steep, slide, valley))

learn.fine_tune(5, 0.0006918309954926372)

interp = ClassificationInterpretation.from_learner(learn)

interp.plot_top_losses(5, nrows=1)