dlpy.embedding_model.EmbeddingModel.build_embedding_model

classmethod EmbeddingModel.build_embedding_model(branch, model_table=None, embedding_model_type='Siamese', embedding_layer=None, margin=None)

Build an embedding model based on a given model branch and model type

Parameters:
branch : Model

Specifies the base model that is used as branches for embedding model.

model_table : string or dict or CAS table, optional

Specifies the CAS table to store the deep learning model.
Default: None

embedding_model_type : string, optional

Specifies the embedding model type that the created table will be applied for training.
Valid Values: Siamese, Triplet, and Quartet.
Default: Siamese

embedding_layer: Layer, optional

Specifies a dense layer as the embedding layer. For instance, Dense(n=10, act=’identity’) defines the embedding dimension is 10. When it is not given, the last layer (except the task layers) in the branch model will be used as the embedding layer.

margin: double, optional

Specifies the margin value used by the embedding model. When it is not given, for Siamese, margin is 2.0. Otherwise, margin is 0.0.

Returns:
Model