Skip to content

Conversation

@reyoung
Copy link
Collaborator

@reyoung reyoung commented Jan 11, 2017

Review #1108 #1121 first.

@reyoung reyoung force-pushed the feature/quick_start_api branch from 8b91327 to 552b2e4 Compare January 11, 2017 14:30
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

2 participants