Guest User

Untitled

a guest
Feb 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. from fastai.vision import *
  2. import neptune
  3. from neptunecontrib.monitoring.fastai import NeptuneMonitor
  4.  
  5. ctx = neptune.Context()
  6.  
  7. mnist = untar_data(URLs.MNIST_TINY)
  8. tfms = get_transforms(do_flip=False)
  9.  
  10. data = (ImageItemList.from_folder(mnist)
  11. .split_by_folder()
  12. .label_from_folder()
  13. .transform(tfms, size=32)
  14. .databunch()
  15. .normalize(imagenet_stats))
  16.  
  17. neptune_monitor = NeptuneMonitor(ctx=ctx)
  18. learn = create_cnn(data, models.resnet18, metrics=accuracy, callbacks=[neptune_monitor])
  19. learn.fit_one_cycle(2, 1e-2)
Add Comment
Please, Sign In to add comment