Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save parameters into ordered dict. #3701

Merged

Conversation

lcy-seso
Copy link
Contributor

@lcy-seso lcy-seso commented Aug 27, 2017

fixes #3704

@lcy-seso lcy-seso requested a review from reyoung August 27, 2017 03:37
@lcy-seso lcy-seso force-pushed the save_parameter_name_in_ordereddict branch from 912f3a0 to 4a83dde Compare August 27, 2017 05:48
@lcy-seso lcy-seso requested review from typhoonzero and removed request for reyoung August 27, 2017 05:53
typhoonzero
typhoonzero previously approved these changes Aug 27, 2017
Copy link
Contributor

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM++

Better to add some doc string for class Parameters so that we can figure out why use OrderedDict.

@lcy-seso
Copy link
Contributor Author

@typhoonzero I will add the doc.

Parameters is the name of parameter. The value of Parameters is a plain
:code:`numpy.ndarry` .
`Parameters` manages all the learnable parameters in a neural network.
It stores parameters' information in an OrderedDict, key of which is
Copy link
Contributor

Choose a reason for hiding this comment

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

key of which is => key is ..., and value is ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

`Parameters` manages all the learnable parameters in a neural network.
It stores parameters' information in an OrderedDict, key of which is
the name of a parameter, and value related to a key is a parameter's
configuration, such as initialization mean and std, its size, whether it is
Copy link
Contributor

Choose a reason for hiding this comment

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

configuration(in protobuf format)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

configuration, such as initialization mean and std, its size, whether it is
a static parameter, and so on.

:param __param_conf__: this member stores the configurations of learnable
Copy link
Contributor

Choose a reason for hiding this comment

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

remove "this member"

:param __param_conf__: this member stores the configurations of learnable
parameters in a network in an OrderedDict. The parameters are added by
following their creation order in the neural network one by one:
parameters of the previous layers in a network are careted first.
Copy link
Contributor

Choose a reason for hiding this comment

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

careted => created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

parameters in a network in an OrderedDict. The parameters are added by
following their creation order in the neural network one by one:
parameters of the previous layers in a network are careted first.
When a user iterates over this dict, he can visit parameters in the
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 visit the parameters from bottom to top by iterating over this dict.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Contributor Author

@lcy-seso lcy-seso left a comment

Choose a reason for hiding this comment

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

follow comments, thank you.

Parameters is the name of parameter. The value of Parameters is a plain
:code:`numpy.ndarry` .
`Parameters` manages all the learnable parameters in a neural network.
It stores parameters' information in an OrderedDict, key of which is
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

`Parameters` manages all the learnable parameters in a neural network.
It stores parameters' information in an OrderedDict, key of which is
the name of a parameter, and value related to a key is a parameter's
configuration, such as initialization mean and std, its size, whether it is
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

:param __param_conf__: this member stores the configurations of learnable
parameters in a network in an OrderedDict. The parameters are added by
following their creation order in the neural network one by one:
parameters of the previous layers in a network are careted first.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

parameters in a network in an OrderedDict. The parameters are added by
following their creation order in the neural network one by one:
parameters of the previous layers in a network are careted first.
When a user iterates over this dict, he can visit parameters in the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@lcy-seso lcy-seso force-pushed the save_parameter_name_in_ordereddict branch from 20586ab to 313ca88 Compare August 28, 2017 04:25
@lcy-seso lcy-seso force-pushed the save_parameter_name_in_ordereddict branch from 313ca88 to f0b25c4 Compare August 28, 2017 04:28
Copy link
Contributor

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM++

@lcy-seso lcy-seso merged commit 2e3f2af into PaddlePaddle:develop Aug 28, 2017
@lcy-seso lcy-seso deleted the save_parameter_name_in_ordereddict branch August 28, 2017 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

save parameters into ordered dict
2 participants