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

API Refactorization #1392

Closed
wangkuiyi opened this issue Feb 21, 2017 · 3 comments
Closed

API Refactorization #1392

wangkuiyi opened this issue Feb 21, 2017 · 3 comments

Comments

@wangkuiyi
Copy link
Collaborator

wangkuiyi commented Feb 21, 2017

Layers: @jacquesqiao should be done in 2017-2-23

Data: should be done in 2017-2-27

Activations should be done in 2017-2-23

Event: @reyoung should be done in 2017-2-23

@qingqing01
Copy link
Contributor

qingqing01 commented Feb 22, 2017

semantic_role_labeling出发,写API训练,一些想到的问题:

网络配置

ParameterAttribute、xx_projection等其他不在python/paddle/v2中的如何引入包。这些目前在: python/paddle/trainer_config_helpers

确实要包装成Python代码。 在 #1402 列了出具体要做的工作。除了上述工作,还有RNN layers相关的一些工作。 请 @jacquesqiao @luotao1 @gangliao @qingiqng 来分工。

训练

parameters 初始化问题:C++还是Python?如果是python需要提供常用初始化接口吧?

目前通过ParameterAttribute 来指定parameter的初始化方法。目前支持两种方法:Gaussian RNG 和 uniform distributed RNG。实际上有很多方法来初始化参数: http://stats.stackexchange.com/questions/47590/what-are-good-initial-weights-in-a-neural-network @reyoung @qingqing01

optimizer: 其他demo需要完善python/paddle/v2/optimizer.py内容,目前只有Adam,Adamax。

@qingqing01

L2-Regularization 如何设置? 5 / 8 demo有正则

v2 API已经支持了——在创建trainer的时候指定。未来可能要支持per-layer的regularization。

Testing during training event_handler需要支持

@reyoung 会来写 paddle.test 和 paddle.infer

其他

疑问:网络连接如下:

          B_cost_layer:是cost层, paddle.parameters.create(B_layer)即可训练
        / 
A_layer
        \ 
         C_layer  和 B_layer共享参数,testing用。
 

按照训练topology=B_cost_layer即可,topology=[B_cost_layer, C_layer]吗? 否则的话testing如何拿到C_layer的输出?

    trainer.train(train_data_reader=train_reader,
                  topology=[B_cost_layer, C_layer],
                  ...)

@wangkuiyi
Copy link
Collaborator Author

wangkuiyi commented Feb 22, 2017

Testing during training:event_handler需要支持

在我脑海里,我理解你给出的例子可以这么描述:

a_layer = paddle.layer.SomeLayer()
b_cost = paddle.layer.SomeCost(a_layer)
c_cost = paddle.layer.SomeOtherCost(a_layer)

parameters = paddle.parameters.create([b_cost, c_cost])

def event_handler(event):
    if isinstande(event, paddle.event.EndIteration):
        print paddle.test(c_cost,
                   parameters,
                   paddle.dataset.mnist.testing_data())
        
paddle.train(b_cost,
             parameters,
             paddle.dataset.mnist.training_data(),
             event_handler)

请看这样可以吗?

@reyoung
Copy link
Collaborator

reyoung commented May 3, 2017

This issue has been done.

@reyoung reyoung closed this as completed May 3, 2017
wangxicoding pushed a commit to wangxicoding/Paddle that referenced this issue Dec 9, 2021
* fix id in the last position

* fix

Co-authored-by: Guo Sheng <[email protected]>
Co-authored-by: smallv0221 <[email protected]>
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

No branches or pull requests

3 participants