finetuner.tailor package

Subpackages

Submodules

Module contents

finetuner.tailor.to_embedding_model(model, layer_name=None, output_dim=None, freeze=False, input_size=None, input_dtype='float32', **kwargs)[source]

Convert a general model from model to an embedding model.

Parameters
  • model (AnyDNN) – The DNN model to be converted.

  • layer_name (Optional[str]) – the name of the layer that is used for output embeddings. All layers after that layer will be removed. When set to None, then the last layer listed in embedding_layers will be used. To see all available names you can check name field of embedding_layers.

  • output_dim (Optional[int]) – the dimensionality of the embedding output.

  • freeze (bool) – if set, then freeze all weights of the original model.

  • input_size (Optional[Tuple[int, …]]) – The input size of the DNN model.

  • input_dtype (str) – The input data type of the DNN model.

Return type

AnyDNN

finetuner.tailor.display(model, input_size=None, input_dtype='float32')[source]

Display the model architecture from summary in a table.

Parameters
  • model (AnyDNN) – The DNN model to display.

  • input_size (Optional[Tuple[int, …]]) – The input size of the DNN model.

  • input_dtype (str) – The input data type of the DNN model.

Return type

None