This repository was archived by the owner on Nov 17, 2023. It is now read-only.
[TUTORIAL] Revise Naming tutorial#15365
Merged
ThomasDelteil merged 3 commits intoapache:masterfrom Jul 5, 2019
Merged
Conversation
thomelane
reviewed
Jun 26, 2019
docs/tutorials/gluon/naming.md
Outdated
| The same principle also applies to container blocks like Sequential. `name_scope` can be used inside `__init__` as well as out side of `__init__`: | ||
| **It is recommended that you manually specify a prefix for the top level `Block`, i.e. `model = Model(prefix='mymodel_')`, to avoid potential confusion in naming.** | ||
|
|
||
| The same principle applies to container blocks like [`Sequential`](https://mxnet.incubator.apache.org/versions/master/api/python/gluon/gluon.html#mxnet.gluon.nn.Sequential). `name_scope` can be used inside as well as outside of `__init__`: |
Contributor
There was a problem hiding this comment.
The same principle applies -> The same principle applies
docs/tutorials/gluon/naming.md
Outdated
| The same principle also applies to container blocks like Sequential. `name_scope` can be used inside `__init__` as well as out side of `__init__`: | ||
| **It is recommended that you manually specify a prefix for the top level `Block`, i.e. `model = Model(prefix='mymodel_')`, to avoid potential confusion in naming.** | ||
|
|
||
| The same principle applies to container blocks like [`Sequential`](https://mxnet.incubator.apache.org/versions/master/api/python/gluon/gluon.html#mxnet.gluon.nn.Sequential). `name_scope` can be used inside as well as outside of `__init__`: |
Contributor
There was a problem hiding this comment.
Can tell whether you're saying this is recommended or not? Using name scope with Sequential?
docs/tutorials/gluon/naming.md
Outdated
| ) | ||
|
|
||
|
|
||
| As a result, if you try to save parameters from model0 and load it with model1, you'll get an error due to unmatching names: |
Contributor
There was a problem hiding this comment.
"load it with model1"? Might want to rephrase this.
|
|
||
| - In Gluon model zoo, all image classification models follow the format where the feature extraction layers are named `features` while the output layer is named `output`. | ||
| - Note that the output layer is a dense block with 1000 dimension outputs. | ||
| Sometimes you may want to load a pretrained model, and replace certain Blocks in it for fine-tuning. For example, the [`AlexNet`](https://mxnet.incubator.apache.org/versions/master/api/python/gluon/model_zoo.html#vision) model in the model zoo has 1000 output dimensions, but maybe you have only 100 classes in your application. Let's see how to change the number of output dimensions from 1000 to 100. |
Contributor
There was a problem hiding this comment.
Would mention that you can just set classes argument for this case. Guess you're doing like this for demonstration purposes.
Contributor
|
Great, thanks for updates. LGTM. |
Member
|
@mxnet-label-bot add [pr-awaiting-review] |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Update the text of Naming tutorials to make it more readable. Plus adding conclusion and next step sections.