-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Feature/quick start api #1126
Conversation
8b91327
to
552b2e4
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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了。
Closed because mnist should be review first. |
* 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
…n_equal_1_bug fix viterbi len=1 bug
Review #1108 #1121 first.