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

Feature/quick start api #1126

Closed
wants to merge 8 commits into from

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Jan 11, 2017

Review #1108 #1121 first.

Copy link
Collaborator

@wangkuiyi wangkuiyi left a comment

Choose a reason for hiding this comment

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

好像之前有一个PR,里面内容和这个的很像?

opt_config_proto = parse_optimizer_config(optimizer_config)
opt_config = api.OptimizationConfig.createFromProto(opt_config_proto)
_temp_optimizer_ = api.ParameterOptimizer.create(opt_config)
opt_config_proto = paddle.config.parse_optimizer(optimizer_config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里还是不要依赖把 optimzier_config 定义成一个函数。因为这里其实应该不需要protobuf吧。

_temp_optimizer_ = api.ParameterOptimizer.create(opt_config)
opt_config_proto = paddle.config.parse_optimizer(optimizer_config)
opt_config = paddle.raw.OptimizationConfig.createFromProto(opt_config_proto)
_temp_optimizer_ = paddle.raw.ParameterOptimizer.create(opt_config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里需要定义一个temporary variable,不容易理解为什么需要它。

model_config = parse_network_config(network_config)
m = api.GradientMachine.createFromConfigProto(
model_config, api.CREATE_MODE_NORMAL, enable_types)
model_config = paddle.config.parse_network(network_config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

类似的,model_config一定要是protobuf吗?


# This type check is not useful. Only enable type hint in IDE.
# Such as PyCharm
assert isinstance(m, api.GradientMachine)
assert isinstance(m, paddle.raw.GradientMachine)
Copy link
Collaborator

Choose a reason for hiding this comment

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

如果上面的代码是 m = paddle.gradient_mahcine.new(...) ,那么这里不需要这一行,也可以让用户了明白 m 是一个 gradient machine了。

@reyoung
Copy link
Collaborator Author

reyoung commented Jan 18, 2017

Closed because mnist should be review first.

@reyoung reyoung closed this Jan 18, 2017
zhhsplendid pushed a commit to zhhsplendid/Paddle that referenced this pull request Sep 25, 2019
* modify fluid.rst and layers.rst and gen_doc.py

* synchronize api_cn of develop 0823,test=document_preview

* update io_cn.rst

* delete ComposeNotAligned_cn.rst
wangxicoding pushed a commit to wangxicoding/Paddle that referenced this pull request Dec 9, 2021
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.

2 participants