Deep Learning Code Generation Fundamentals
R2026bFunctions, 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
Objects
Code Configuration Parameters
Topics
Basics
- Prerequisites for Deep Learning with MATLAB Coder
Install products and configure environment for code generation for deep learning networks. - Workflow for Deep Learning Code Generation with MATLAB Coder
Generate code for prediction from a pretrained network. - Networks and Layers Supported for Code Generation
Choose a convolutional neural network that is supported for your target processor.
Code Generation
- Load Pretrained Networks for Code Generation
Create adlnetworkobject, or an object detector for code generation. - Analyze Network for Code Generation
Check code generation compatibility of a deep learning network. - Generate Generic C/C++ Code for Deep Learning Networks
Generate C/C++/CUDA code for prediction from a deep learning network that does not depend on third-party libraries. - Code Generation for dlarray
Use deep learning arrays in MATLAB code intended for code generation.
Optimization and Quantization
- Optimize C/C++ Code Performance for Deep Learning Applications without Deep Learning Libraries
Code generation configuration settings that optimize the performance of the generated C/C++ code for a deep learning network. - Compress Networks Learnables in bfloat16 Format
Perform learnables compression and generate C/C++ code in Brain Floating Point format, bfloat16.
Parameter Updates
- Update Network Parameters at Run Time
Update deep learning network parameters at run-time without regenerating code. - Update Network Parameters After Code Generation
Perform post code generation updates of deep learning network parameters.
Code Generation for Third-Party Libraries
- Code Generation for Deep Learning Networks with MKL-DNN
Generate C++ code for prediction from a deep learning network, targeting an Intel® CPU.
Related Information
- Get Started with Deep Learning Toolbox (Deep Learning Toolbox)
- Deep Learning with GPU Coder (GPU Coder)


