Coremltools

Latest version: v8.2

Safety actively analyzes 715032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 7

3.0beta

This is the first beta release of coremltools 3 which aligns with the preview of Core ML 3. It includes a new version of the .mlmodel specification which brings with it support for:

* Updatable models
* More dynamic and expressive neural networks
* Nearest neighbor classifiers
* Recommenders
* Linked models
* Sound analysis preprocessing
* Runtime adjustable parameters

This release also enhances and introduces the following converters and utilities:

* Keras converter
* Adds support for converting training details using respect_trainable flag
* Scikit converter
* Nearest neighbor classifier conversion
* NeuralNetworkBuilder
* Support for all new layers introduced in CoreML 3
* Support for adding update details such as marking layers updatable, specifying a loss function and providing an optimizer
* KNearestNeighborsClassifierBuilder (new)
* Newly added to support simple programatic construction of nearest neighbor classifiers
* Tensorflow (new)
* A new tensorflow converter with improved graph transformation capabilities and support for version 4 of the .mlmodel specification
* This is used by the new tfcoreml beta converter package as well. Try it out with `pip install tfcoreml==0.4.0b1`

This release also adds Python 3.7 support for coremltools

Updatable Models

Core ML 3 supports on-device update of models. Version 4 of the .mlmodel specification can encapsulate all the necessary parameters for a model update. Nearest neighbor, neural networks and pipeline models can all be made updatable.

Updatable neural networks support training of convolution and fully connected layer weights (with back-propagation through many other layers types). Categorical cross entropy and mean squared error losses are available along with stochastic gradient descent and Adam optimizers.

See [examples of how to convert and create updatable models](https://github.com/apple/coremltools/tree/master/examples/updatable_models)

See the [MLUpdateTask API reference](https://developer.apple.com/documentation/coreml/mlupdatetask) for how update a model from within an app.

Neural Networks

* Support for new layers in Core ML 3 added to the NeuralNetworkBuilder
* Exact rank mapping of multi dimensional array inputs
* Control Flow related layers (branch, loop, range, etc.)
* Element-wise unary layers (ceil, floor, sin, cos, gelu, etc.)
* Element-wise binary layers with broadcasting (addBroadcastable, multiplyBroadcastable, etc)
* Tensor manipulation layers (gather, scatter, tile, reverse, etc.)
* Shape manipulation layers (squeeze, expandDims, getShape, etc.)
* Tensor creation layers (fillDynamic, randomNormal, etc.)
* Reduction layers (reduceMean, reduceMax, etc.)
* Masking / Selection Layers (whereNonZero, lowerTriangular, etc.)
* Normalization layers (layerNormalization)
* For a full list of supported layers in Core ML 3, check out CoreML specification documentation (NeuralNetwork.proto).
* Support conversion of recurrent networks from TensorFlow

Known Issues

2.1

2.0

* Support for quantizing Neural Network models (1-8 bits)
* Support for specifying flexible shapes for model inputs
* Added NN builder support for new neural network layers: resize_bilinear, crop_resize
* Added utilities for visualizing and printing summary of neural network models
* Miscellaneous fixes

0.8

* Adds Python 3.5 and 3.6 support
* Fixed compatibility with Keras 2.1.3
* Support for xgboost 0.7
* Fixes: when 1D convolution output is directly fed by flatten layer, Keras converter gives a wrong output shape
* Fixes: Index range bug in keras converter function "make_output_layers()"
* Adds custom activation function support in Keras 2 converter
* Miscellaneous documentation fixes

0.7.0

Neural Networks
* Half precision weights
* New to .mlmodel specification version 2
* Supported by macOS 10.13.2, iOS 11.2, watchOS 4.2, tvOS 11.2
* WeightParams can now be specified in half precision (float16)
* New float16 conversion utility function can convert existing models with neural networks to half precision by calling coremltools.utils.convert_neural_network_spec_weights_to_fp16
* Can also pass in a flag in keras or caffe converter functions during model conversion time to convert models to half precision
* See: https://developer.apple.com/documentation/coreml/reducing_the_size_of_your_core_ml_app
* Custom Layers
* New to .mlmodel specification version 2
* Supported by macOS 10.13.2, iOS 11.2, watchOS 4.2, tvOS 11.2
* Added CustomLayerParams message to possible layers
* NeuralNetworkBuilder has new add_custom method
* Keras converter has options for using custom layers. See add_custom_layers and custom_conversion_functions arguments
* See: https://developer.apple.com/documentation/coreml/core_ml_api/creating_a_custom_layer

Visualization
* Visualize model specification with: coremltools.utils.visualize_spec

Python 3
* Conversion for most model types work in Python 3.
* No predictions: https://github.com/apple/coremltools/issues/37
* Converting Caffe models does not work: https://github.com/apple/coremltools/issues/79
* To use in Python 3, you must build from source.

Misc
* Support grayscale image outputs in python predictions
* Bug fixes

0.6.3

Neural Network Builder

Added support for layers in the NeuralNetworkBuilder that were present in the neural network protobuf but missing from the builder:
* Local response normalization (LRN) layer
* Split layer
* Unary function layer
* Bias, scale layers
* Load constant layer
* L2 normalization layer
* Mean variance normalization (MVN) layer
* Elementwise min layer
* Depthwise and separable convolutions

Added support for some of the missing parameters in NeuralNetworkBuilder:
* Padding options in convolution, pooling and padding layers
* Scale and shift options for linear activation

Other bug fixes & enhancements

* Bug-fix in the caffe converter that was preventing the elementwise max layer from converting.
* Support for converting DepthwiseConv2D and SeparableConv2D from Keras

Page 7 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.