Skip to content

Commit 8a283db

Browse files
committed
Update docs for fm layer
1 parent 89e63b1 commit 8a283db

File tree

1 file changed

+14
-7
lines changed
  • python/paddle/trainer_config_helpers

1 file changed

+14
-7
lines changed

python/paddle/trainer_config_helpers/layers.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7423,18 +7423,25 @@ def factorization_machine(input,
74237423
Factorization machines.
74247424
74257425
.. 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.
74297437
:type input: LayerOutput
74307438
:param factor_size: The hyperparameter that defines the dimensionality of
7431-
the latent vector size
7439+
the latent vector size.
74327440
:type context_len: int
74337441
:param act: Activation Type. Default is linear activation.
74347442
: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.
74387445
:type param_attr: ParameterAttribute
74397446
:param layer_attr: Extra Layer config.
74407447
:type layer_attr: ExtraLayerAttribute|None

0 commit comments

Comments
 (0)