Skip to content

Commit

Permalink
WIP Move OpenAI examples to their own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothiraldan committed Nov 23, 2023
1 parent c09a992 commit c41593c
Show file tree
Hide file tree
Showing 7 changed files with 677 additions and 776 deletions.
1 change: 1 addition & 0 deletions fastai/README.md
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/.
44 changes: 0 additions & 44 deletions fastai/train-example.py

This file was deleted.

Empty file.
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()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
comet_ml
fastai
634 changes: 634 additions & 0 deletions integrations/model-training/fastai/notebooks/fastai_hello_world.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit c41593c

Please sign in to comment.