merlin.models.tf.OptimizerBlocks#

class merlin.models.tf.OptimizerBlocks(optimizer: Union[str, keras.optimizers.legacy.optimizer_v2.OptimizerV2], blocks: Sequence[merlin.models.tf.core.base.Block])[source]#

Bases: object

dataclass for a pair of optimizer and blocks that the optimizer should apply to. .. rubric:: Example

ml.OptimizerBlocks(“sgd”, [user_tower, third_tower]) ml.OptimizerBlocks(“adam”, item_tower)

__init__(optimizer: Union[str, keras.optimizers.legacy.optimizer_v2.OptimizerV2], blocks: Sequence[merlin.models.tf.core.base.Block]) None#

Methods

__init__(optimizer, blocks)

from_config(config)

get_config()

return a tuple of serialized keras objects

Attributes

optimizer

blocks

optimizer: Union[str, keras.optimizers.legacy.optimizer_v2.OptimizerV2]#
blocks: Sequence[merlin.models.tf.core.base.Block]#
get_config()[source]#

return a tuple of serialized keras objects

classmethod from_config(config)[source]#