17
17
18
18
def fc (input ,
19
19
size ,
20
+ num_flatten_dims = 1 ,
20
21
param_attr = None ,
21
22
param_initializer = None ,
22
23
bias_attr = None ,
23
24
bias_initializer = None ,
24
- name = None ,
25
25
act = None ,
26
- num_flatten_dims = 1 ,
26
+ name = None ,
27
27
main_program = None ,
28
28
startup_program = None ):
29
29
"""
@@ -32,15 +32,15 @@ def fc(input,
32
32
Args:
33
33
input: The input tensor to the function
34
34
size: The size of the layer
35
+ num_flatten_dims: Number of columns in input
35
36
param_attr: The parameters/weights to the FC Layer
36
37
param_initializer: Initializer used for the weight/parameter.
37
38
If None, XavierInitializer() is used
38
39
bias_attr: The bias parameter for the FC layer
39
40
bias_initializer: Initializer used for the bias.
40
41
If None, then ConstantInitializer() is used
41
- name: Name/alias of the function
42
42
act: Activation to be applied to the output of FC layer
43
- num_flatten_dims: Number of columns in input
43
+ name: Name/alias of the function
44
44
main_program: Name of the main program that calls this
45
45
startup_program: Name of the startup program
46
46
@@ -111,9 +111,9 @@ def _get_default_bias_initializer():
111
111
112
112
def embedding (input ,
113
113
size ,
114
- data_type = 'float32' ,
115
114
is_sparse = False ,
116
115
param_attr = None ,
116
+ data_type = 'float32' ,
117
117
main_program = None ,
118
118
startup_program = None ):
119
119
"""
@@ -122,9 +122,9 @@ def embedding(input,
122
122
Args:
123
123
input: The input to the function
124
124
size: The size of the layer
125
- data_type: The type of data : float32, float_16, int etc
126
125
is_sparse: A flag that decleares whether the input is sparse
127
126
param_attr: Parameters for this layer
127
+ data_type: The type of data : float32, float_16, int etc
128
128
main_program: Name of the main program that calls this
129
129
startup_program: Name of the startup program
130
130
@@ -152,14 +152,14 @@ def embedding(input,
152
152
# TODO(qijun): expose H0 and C0
153
153
def dynamic_lstm (input ,
154
154
size ,
155
- data_type = 'float32' ,
156
155
param_attr = None ,
157
156
bias_attr = None ,
158
157
use_peepholes = True ,
159
158
is_reverse = False ,
160
159
gate_activation = 'sigmoid' ,
161
160
cell_activation = 'tanh' ,
162
161
candidate_activation = 'tanh' ,
162
+ data_type = 'float32' ,
163
163
main_program = None ,
164
164
startup_program = None ):
165
165
helper = LayerHelper ('lstm' , ** locals ())
@@ -200,9 +200,9 @@ def dynamic_lstm(input,
200
200
201
201
def data (name ,
202
202
shape ,
203
+ append_batch_size = True ,
203
204
data_type = 'float32' ,
204
205
type = core .VarDesc .VarType .LOD_TENSOR ,
205
- append_batch_size = True ,
206
206
main_program = None ,
207
207
startup_program = None ,
208
208
stop_gradient = True ):
@@ -212,9 +212,9 @@ def data(name,
212
212
Args:
213
213
name: The name/alias of the function
214
214
shape: Tuple declaring the shape.
215
+ append_batch_size: Whether or not to append the data as a batch.
215
216
data_type: The type of data : float32, float_16, int etc
216
217
type: The output type. By default it is LOD_TENSOR.
217
- append_batch_size: Whether or not to append the data as a batch.
218
218
main_program: Name of the main program that calls this
219
219
startup_program: Name of the startup program
220
220
stop_gradient: A boolean that mentions whether gradient should flow.
@@ -600,12 +600,12 @@ def sequence_conv(input,
600
600
num_filters ,
601
601
filter_size = 3 ,
602
602
filter_stride = 1 ,
603
- act = None ,
604
603
padding = None ,
605
604
bias_attr = None ,
606
605
bias_initializer = None ,
607
606
param_attr = None ,
608
607
param_initializer = None ,
608
+ act = None ,
609
609
main_program = None ,
610
610
startup_program = None ):
611
611
"""
@@ -658,16 +658,16 @@ def _get_default_param_initializer():
658
658
659
659
def conv2d (input ,
660
660
num_filters ,
661
- name = None ,
662
- filter_size = [1 , 1 ],
663
- act = None ,
664
- groups = None ,
661
+ filter_size ,
665
662
stride = [1 , 1 ],
666
663
padding = None ,
667
- bias_attr = None ,
668
- bias_initializer = None ,
664
+ groups = None ,
669
665
param_attr = None ,
670
666
param_initializer = None ,
667
+ bias_attr = None ,
668
+ bias_initializer = None ,
669
+ act = None ,
670
+ name = None ,
671
671
main_program = None ,
672
672
startup_program = None ):
673
673
"""
0 commit comments