elliot.recommender.neural.NAIS package¶
Submodules¶
elliot.recommender.neural.NAIS.nais module¶
Module description:
-
class
elliot.recommender.neural.NAIS.nais.
NAIS
(data, config, params, *args, **kwargs)[source]¶ Bases:
elliot.recommender.recommender_utils_mixin.RecMixin
,elliot.recommender.base_recommender_model.BaseRecommenderModel
NAIS: Neural Attentive Item Similarity Model for Recommendation
For further details, please refer to the paper
- Parameters
factors – Number of latent factors
algorithm – Type of user-item factor operation (‘product’, ‘concat’)
weight_size – List of units for each layer
lr – Learning rate
l_w – Regularization coefficient
l_b – Bias regularization coefficient
alpha – Attention factor
beta – Smoothing exponent
neg_ratio – Ratio of negative sampled items, e.g., 0 = no items, 1 = all un-rated items
To include the recommendation model, add it to the config file adopting the following pattern:
models: NAIS: meta: save_recs: True factors: 100 batch_size: 512 algorithm: concat weight_size: 32 lr: 0.001 l_w: 0.001 l_b: 0.001 alpha: 0.5 beta: 0.5 neg_ratio: 0.5
-
property
name
¶
elliot.recommender.neural.NAIS.nais_model module¶
Module description:
-
class
elliot.recommender.neural.NAIS.nais_model.
LatentFactor
(*args, **kwargs)[source]¶ Bases:
tensorflow.python.keras.layers.embeddings.Embedding
-
class
elliot.recommender.neural.NAIS.nais_model.
NAIS_model
(*args, **kwargs)[source]¶ Bases:
tensorflow.python.keras.engine.training.Model
-
get_config
()[source]¶ Returns the config of the layer.
A layer config is a Python dictionary (serializable) containing the configuration of a layer. The same layer can be reinstantiated later (without its trained weights) from this configuration.
The config of a layer does not include connectivity information, nor the layer class name. These are handled by Network (one layer of abstraction above).
- Returns
Python dictionary.
-