Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

关于Mixed Layer

Open VamWolf opened this issue 10 years ago • 4 comments

   with mixed_layer(size=256) as m:
       m += full_matrix_projection(input=layer1)
       m += identity_projection(input=layer2)

新paddle 的这个语法,与下面的这个写法的意思是一样的吧?除了看demo.还有官员Layer 配置的一些教程写法么. 为什么配置成这样的?

   MixedLayer(
        name = query + "_reverse_rnn%d_input" % j,
        size = hidden_dim, 
        bias = False,
        inputs = [FullMatrixProjection( j,
                initial_std = 1 / math.sqrt(hidden_dim), 
                parameter_name = "  j,
                learning_rate =lr_hid_col), 

VamWolf avatar Nov 03 '16 12:11 VamWolf

与下面写法的意思不一样,上面的input有full_matrix_projection和identity_projection,下面只有一个FullMatrixProjection。另外上面没有设learning_rate和initial_std。新paddle的layer写法,和tensorflow/mxnet类似,更加简洁,并有一定的CHECK机制。

luotao1 avatar Nov 04 '16 02:11 luotao1

那learning rate ,initial std 这些参数在哪设置的. 有更详细的这种语法类的么.

VamWolf avatar Nov 04 '16 06:11 VamWolf

@VamWolf http://www.paddlepaddle.org/doc/ui/api/trainer_config_helpers/attrs.html#paddle.trainer_config_helpers.attrs.ParameterAttribute http://www.paddlepaddle.org/doc/ui/api/trainer_config_helpers/layers.html#full-matrix-projection

reyoung avatar Nov 04 '16 06:11 reyoung

可以参考https://github.com/baidu/Paddle/blob/develop/demo/sentiment/sentiment_net.py 中stacked_lstm_net的配置方法

luotao1 avatar Nov 04 '16 06:11 luotao1