Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Gluon end to end tutorial #13411

Merged
merged 16 commits into from
Jan 24, 2019
Merged

Gluon end to end tutorial #13411

merged 16 commits into from
Jan 24, 2019

Conversation

roywei
Copy link
Member

@roywei roywei commented Nov 26, 2018

Description

This tutorials aims to provide Gluon users an overview of the end to end workflow from training to inference. Since there are too many sections in the workflow, we will use a simple fine tuning example and provide links to more details tutorials on each specific topic.

The sections including:

  1. Load pre-trained model
  2. Modify the network using Gluon imperative mode
  3. Hybridize the network and training
  4. Save fine-tuned model
  5. Inferece using C++ API

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@roywei roywei requested a review from szha as a code owner November 26, 2018 18:02
@stu1130
Copy link
Contributor

stu1130 commented Nov 26, 2018

@mxnet-label-bot add [pr-work-in-progress]
Thanks for your contribution @roywei

@marcoabreu marcoabreu added the pr-work-in-progress PR is still work in progress label Nov 26, 2018
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved

You can use this [script](https://github.com/Arsey/keras-transfer-learning-for-oxford102/blob/master/bootstrap.py) to download and organize your data into train, test, and validation sets. Simply run:
```python
python bootstrap.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use DataLoaders/Transforms here?

docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
docs/tutorials/gluon/gluon_from_experiment_to_deploymen.md Outdated Show resolved Hide resolved
@roywei
Copy link
Member Author

roywei commented Dec 18, 2018

@nswamy @ThomasDelteil addressed the feedback, could you take another look? Thanks!

@Roshrini
Copy link
Member

Roshrini commented Jan 2, 2019

@ThomasDelteil @nswamy @aaronmarkham Can you take a look again?

Copy link
Contributor

@aaronmarkham aaronmarkham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling and grammar fixes have been provided.
This is a great tutorial. I do have a suggestion though. Break it up. This will get filed under the gluon (python) folder. Why not split it up, so that the Python transfer learning stuff is in the gluon folder and then the CPP stuff goes into the CPP folder? Then if you add some further examples of how to take that new model and host it with MMS or use Java API, you can add links to those tutorials too. Otherwise if people look around in the CPP folder they won't see this great example...

If you do decide to break it up, please apply/commit my spelling and grammar fixes first, so that those change requests don't get lost in the shuffle.

docs/tutorial_utils/data/oxford_102_flower_dataset.py Outdated Show resolved Hide resolved
iterations_per_epoch = math.ceil(num_batch)
# learning rate change at following steps
lr_steps = [epoch * iterations_per_epoch for epoch in lr_epochs]
schedule = mx.lr_scheduler.MultiFactorScheduler(step=lr_steps, factor=lr_factor, base_lr=lr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can pass directly this schedule into your trainer rather than calling on very iteration, check the tutorials on learning rate scheduler

@roywei
Copy link
Member Author

roywei commented Jan 16, 2019

Hi @aaronmarkham @ThomasDelteil, I have addressed your comments and separated into two tutorials. Please let me know if it's good to go. Thanks!

@roywei roywei changed the title [WIP] Gluon end to end tutorial Gluon end to end tutorial Jan 16, 2019
@roywei
Copy link
Member Author

roywei commented Jan 24, 2019

@aaronmarkham @ThomasDelteil could you help merge if looks good? Thanks!

@ThomasDelteil ThomasDelteil merged commit 4700b40 into apache:master Jan 24, 2019
jessr92 pushed a commit to jessr92/incubator-mxnet that referenced this pull request Jan 27, 2019
* initial draft gluon tutorial

* add reference

* add cpp inference

* improve wording

* address pr comments

* add util functions on dataset

* move util file

* update link

* fix typo, add test

* allow download

* update wording

* update links

* address comments

* use lr scheduler with optimizer

* separate into 2 tutorials

* add c++ tutorial to test whitelist
@ThomasDelteil
Copy link
Contributor

@roywei Have you added this tutorial to the index? Can't find it on the website

stephenrawls pushed a commit to stephenrawls/incubator-mxnet that referenced this pull request Feb 16, 2019
* initial draft gluon tutorial

* add reference

* add cpp inference

* improve wording

* address pr comments

* add util functions on dataset

* move util file

* update link

* fix typo, add test

* allow download

* update wording

* update links

* address comments

* use lr scheduler with optimizer

* separate into 2 tutorials

* add c++ tutorial to test whitelist
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* initial draft gluon tutorial

* add reference

* add cpp inference

* improve wording

* address pr comments

* add util functions on dataset

* move util file

* update link

* fix typo, add test

* allow download

* update wording

* update links

* address comments

* use lr scheduler with optimizer

* separate into 2 tutorials

* add c++ tutorial to test whitelist
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-work-in-progress PR is still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants