-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Move OpenAI examples to their own folder
- Loading branch information
1 parent
c09a992
commit c41593c
Showing
7 changed files
with
677 additions
and
776 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
All of the fastai examples has been moved here: https://github.com/comet-ml/comet-examples/tree/master/integrations/model-training/fastai/. |
This file was deleted.
Oops, something went wrong.
Empty file.
40 changes: 40 additions & 0 deletions
40
integrations/model-training/fastai/fastai-hello-world/fastai_hello_world.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# coding: utf-8 | ||
import comet_ml | ||
|
||
from fastai.vision.all import ( | ||
Categorize, | ||
Datasets, | ||
GrandparentSplitter, | ||
IntToFloatTensor, | ||
PILImageBW, | ||
ToTensor, | ||
URLs, | ||
error_rate, | ||
get_image_files, | ||
parent_label, | ||
resnet18, | ||
untar_data, | ||
vision_learner, | ||
) | ||
|
||
EPOCHS = 5 | ||
|
||
comet_ml.init(project_name="comet-examples-fastai-hello-world") | ||
experiment = comet_ml.Experiment() | ||
|
||
path = untar_data(URLs.MNIST_TINY) | ||
|
||
items = get_image_files(path) | ||
tds = Datasets( | ||
items, | ||
[PILImageBW.create, [parent_label, Categorize()]], | ||
splits=GrandparentSplitter()(items), | ||
) | ||
dls = tds.dataloaders(after_item=[ToTensor(), IntToFloatTensor()]) | ||
|
||
learn = vision_learner(dls, resnet18, pretrained=True, metrics=error_rate) | ||
|
||
with experiment.train(): | ||
learn.fit_one_cycle(EPOCHS) | ||
|
||
experiment.end() |
2 changes: 2 additions & 0 deletions
2
integrations/model-training/fastai/fastai-hello-world/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
comet_ml | ||
fastai |
634 changes: 634 additions & 0 deletions
634
integrations/model-training/fastai/notebooks/fastai_hello_world.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.