Main Content

Deep Learning Code Generation Fundamentals

R2026b
Functions, objects, and workflows that you can use to generate code for deep learning networks

Use MATLAB® Coder™ with Deep Learning Toolbox™ to generate C or C++ code from trained deep learning network. You can generate generic C or C++ code that does not depend on third-party libraries.

Functions

expand all

codegenGenerate C or C++ code from MATLAB code
coder.loadDeepLearningNetworkLoad deep learning network model
coder.DeepLearningConfigCreate deep learning code generation configuration objects
coder.ai.enableParameterUpdateEnables run-time update of network parameters (Since R2025a)
analyzeNetworkForCodegenAnalyze deep learning network for code generation (Since R2022b)
coder.regenerateDeepLearningParametersRegenerate files containing network learnables and states parameters

Objects

expand all

coder.DeepLearningCodeConfigParameters to configure deep learning code generation that does not depend on third-party libraries
coder.MklDNNConfigParameters to configure deep learning code generation with the Intel Math Kernel Library for Deep Neural Networks

Code Configuration Parameters

expand all

Deep learning target libraryTarget library for deep learning code generation
Learnables compressionCompression type
Compute precisionCompute precision

Topics

Basics

Code Generation

Optimization and Quantization

Parameter Updates

Code Generation for Third-Party Libraries

Related Information

Featured Examples