-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nerf_integration
- Loading branch information
Showing
11 changed files
with
408 additions
and
814 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
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.
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
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
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
30 changes: 30 additions & 0 deletions
30
integrations/model-training/fastai/fastai-hello-world/README.md
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,30 @@ | ||
# FastAI integration with Comet.ml | ||
|
||
[fastai](https://github.com/fastai/fastai) is a deep learning library which provides practitioners with high-level components that can quickly and easily provide state-of-the-art results in standard deep learning domains, and provides researchers with low-level components that can be mixed and matched to build new approaches. | ||
|
||
Instrument fastai with Comet to start managing experiments, create dataset versions and track hyperparameters for faster and easier reproducibility and collaboration. | ||
|
||
## Documentation | ||
|
||
For more information on using and configuring the fastai integration, see: [https://www.comet.com/docs/v2/integrations/ml-frameworks/fastai/](https://www.comet.com/docs/v2/integrations/ml-frameworks/fastai/?utm_source=comet-examples&utm_medium=referral&utm_campaign=github_repo_2023&utm_content=fastai) | ||
|
||
## See it | ||
|
||
Take a look at this [public Comet Project](https://www.comet.com/examples/comet-examples-fastai-hello-world/view/new/panels?utm_source=comet-examples&utm_medium=referral&utm_campaign=github_repo_2023&utm_content=fastai). | ||
|
||
## Setup | ||
|
||
Install dependencies | ||
|
||
```bash | ||
python -m pip install -r requirements.txt | ||
``` | ||
|
||
## Run the example | ||
|
||
This example is fine-tuning a pre-trained resnet 28 model on the Mnist Tiny dataset for 5 epochs: | ||
|
||
|
||
```bash | ||
python fastai-hello-world.py | ||
``` |
39 changes: 39 additions & 0 deletions
39
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,39 @@ | ||
# 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) | ||
|
||
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 |
Oops, something went wrong.