Contents

BNNS

Implement and run neural networks for training and inference.

Overview

The Accelerate framework’s BNNS library is a collection of functions that you use to construct neural networks for training and inference. BNNS provides routines optimized for high performance and low energy consumption across all Apple platforms.

The BNNSGraph API provides the means to build CPU based neural networks from the mlmodelc file that Xcode compiles from an ML package.

BNNSGraph allows the BNNS library to execute entire networks rather than individual layers. By considering the full model, BNNS can apply graph-level optimizations such as omitting unnecessary copy operations, fusing computational kernels, and avoiding computing redundant information. Furthermore, BNNS can optimize data layouts for constant data — such as convolution weights — and this allows the fastest execution on specific hardware. These optimizations can represent significant performance and energy-efficiency improvements.

Topics

Building graphs in Swift

Creating and executing graphs in Swift

Compiling a graph object

Specifying and querying compilation options

Specifying a graph’s compile-time message callback

Querying a graph’s properties

Creating and destroying a context

Specifying and querying a context’s properties

Specifying a context’s execute-time message callback

Specifying a context’s allocation callbacks

Specifying and querying a tensor’s properties

Executing a graph

Enumerations

Structures

Protocols

Macros

Deprecated symbols

See Also

Neural Networks