merlin.models.tf.PLEBlock#

merlin.models.tf.PLEBlock(num_layers: int, outputs: Union[List[str], List[merlin.models.tf.prediction_tasks.base.PredictionTask], merlin.models.tf.prediction_tasks.base.ParallelPredictionBlock, merlin.models.tf.core.combinators.ParallelBlock], expert_block: Union[merlin.models.tf.core.base.Block, keras.engine.base_layer.Layer], num_task_experts: int = 1, num_shared_experts: int = 1, gate_block: Optional[merlin.models.tf.core.base.Block] = None, gate_softmax_temperature: float = 1.0, enable_gate_weights_metrics: bool = False, name: Optional[str] = None, **kwargs)[source]#

Implements the Progressive Layered Extraction (PLE) model from [1], by stacking CGC blocks (CGCBlock).

References

[1] Tang, Hongyan, et al. “Progressive layered extraction (ple): A novel multi-task learning (mtl) model for personalized recommendations.” Fourteenth ACM Conference on Recommender Systems. 2020.

Parameters
  • num_layers (int) – Number of stacked CGC blocks

  • outputs (Union[List[str], List[PredictionTask], ParallelPredictionBlock, ParallelBlock]) – Names of the tasks or PredictionTask/ParallelPredictionBlock objects from which we can extract the task names

  • expert_block (Union[Block, tf.keras.layers.Layer]) – Block that will be used for the experts

  • num_task_experts (int, optional) – Number of task-specific experts, by default 1

  • num_shared_experts (int, optional) – Number of shared experts for tasks, by default 1

  • gate_block (Optional[Block], optional) – Optional block than can make the Gate mode powerful in converting the inputs into expert weights for averaging, by default None

  • gate_softmax_temperature (float, optional) – Temperature of the softmax used by the Gates for getting weights for the average. Temperature can be used to smooth the weights distribution, and is by default 1.0.

  • enable_gate_weights_metrics (bool, optional) – Enables logging the average gate weights on experts

  • name (Optional[str], optional) – Name of the PLE block, by default None

Returns

Returns the PLE block

Return type

SequentialBlock