update_model_parameters

update_model_parameters(model, params=None, description=None, output=None, accelerator=None)[source]

Update the parameters of a previously trained model

This updates the metadata of a previously trained .tflite model. The parameters are taken from either the given yzlite.core.YZLiteModel’s python script or the given “params” dictionary and added to the .tflite model file.

Note

The .tflite metadata is only modified. The weights and model structure of the .tflite file are NOT modified.

Parameters:
  • model (Union[YZLiteModel, TfliteModel, str]) – Either the name of a model a yzlite.core.YZLiteModel or yzlite.core.TfliteModel instance or the path to a .tflite model file or .yzlite.zip model archive

  • params (Optional[dict]) – Optional dictionary of parameters to add .tflite. If omitted then model argument must be a yzlite.core.YZLiteModel instance or model name

  • description (Optional[str]) – Optional description to add to .tflite

  • output (Optional[str]) – Optional, directory path or file path to generated .tflite file. If none then generate in model log directory. If output=’tflite_model’, then return the yzlite.core.TfliteModel object instead of .tflite file path

  • accelerator (Optional[str]) – Optional hardware accelerator to use when determining the runtime_memory_size parameter. If None then default to the CMSIS kernels for calculating the required tensor arena size.

Return type:

Union[str, TfliteModel]

Returns:

The file path to the generated .tflite OR TfliteModel object if output=`tflite_model`