File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
python/paddle/trainer_config_helpers Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -7423,18 +7423,25 @@ def factorization_machine(input,
7423
7423
Factorization machines.
7424
7424
7425
7425
.. code-block:: python
7426
- factor_machine = factorization_machine(input=input_layer, factor_size=10)
7427
-
7428
- :param input: The input layer.
7426
+ first_order = paddle.layer.fc(input=input,
7427
+ size=1,
7428
+ act=paddle.activation.Linear())
7429
+ second_order = paddle.layer.factorization_machine(input=input,
7430
+ factor_size=10)
7431
+ fm = paddle.layer.addto(input=[first_order, second_order],
7432
+ act=paddle.activation.Linear(),
7433
+ bias_attr=False)
7434
+
7435
+ :param input: The input layer. Supported input types: all input data types
7436
+ on CPU, and only dense input types on GPU.
7429
7437
:type input: LayerOutput
7430
7438
:param factor_size: The hyperparameter that defines the dimensionality of
7431
- the latent vector size
7439
+ the latent vector size.
7432
7440
:type context_len: int
7433
7441
:param act: Activation Type. Default is linear activation.
7434
7442
:type act: BaseActivation
7435
- :param param_attr: The Parameter Attribute. If None, the latent vectors will
7436
- be initialized smartly. It's better to set it by
7437
- yourself.
7443
+ :param param_attr: The parameter attribute. See ParameterAttribute for
7444
+ details.
7438
7445
:type param_attr: ParameterAttribute
7439
7446
:param layer_attr: Extra Layer config.
7440
7447
:type layer_attr: ExtraLayerAttribute|None
You can’t perform that action at this time.
0 commit comments