--- title: AFN keywords: fastai sidebar: home_sidebar summary: "A pytorch implementation of AFN." description: "A pytorch implementation of AFN." nb_path: "nbs/models/models.afn.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class LNN[source]

LNN(num_fields, embed_dim, LNN_dim, bias=False) :: Module

A pytorch implementation of LNN layer Input shape

- A 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.

Output shape

- 2D tensor with shape:``(batch_size,LNN_dim*embedding_size)``.

Arguments

- **in_features** : Embedding of feature.
- **num_fields**: int.The field size of feature.
- **LNN_dim**: int.The number of Logarithmic neuron.
- **bias**: bool.Whether or not use bias in LNN.
{% endraw %} {% raw %}

class AFN[source]

AFN(field_dims, embed_dim, LNN_dim, mlp_dims, dropouts) :: Module

A pytorch implementation of AFN. Reference: Cheng W, et al. Adaptive Factorization Network: Learning Adaptive-Order Feature Interactions, 2019.

{% endraw %} {% raw %}
{% endraw %}

References:-- Cheng W, et al. Adaptive Factorization Network: Learning Adaptive-Order Feature Interactions, 2019.