tf.lite.Optimize
Перечисление, определяющее оптимизации, применяемые при создании модели tflite.
DEFAULT Стратегия оптимизации по умолчанию, включающая посттренировочную квантизацию. Тип используемой посттренировочной квантизации зависит от других указанных параметров конвертера. Дополнительную информацию о доступных типах и их использовании см. в документации.
OPTIMIZE_FOR_SIZE Устарело. Выполняет то же, что и DEFAULT.
OPTIMIZE_FOR_LATENCY Устарело. Выполняет то же, что и DEFAULT.
EXPERIMENTAL_SPARSITY Экспериментальный флаг, который может измениться.
Enable optimization by taking advantage of the sparse model weights trained with pruning. The converter will inspect the sparsity pattern of the model weights and do its best to improve size and latency. The flag can be used alone to optimize float32 models with sparse weights. It can also be used together with the DEFAULT optimization mode to optimize quantized models with sparse weights.
| Переменные класса | |
|---|---|
| DEFAULT | <Optimize.DEFAULT: 'DEFAULT'> |
| EXPERIMENTAL_SPARSITY | <Optimize.EXPERIMENTAL_SPARSITY: 'EXPERIMENTAL_SPARSITY'> |
| OPTIMIZE_FOR_LATENCY | <Optimize.OPTIMIZE_FOR_LATENCY: 'OPTIMIZE_FOR_LATENCY'> |
| OPTIMIZE_FOR_SIZE | <Optimize.OPTIMIZE_FOR_SIZE: 'OPTIMIZE_FOR_SIZE'> |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/lite/Optimize