![](https://csdnimg.cn/release/download_crawler_static/13035438/bg14.jpg)
Image Classication and Network Prediction Blocks: Simulate and
generate code for deep learning models in Simulink
In R2020b, you can simulate and generate code for trained deep learning networks in Simulink
®
.
The Deep Neural Networks block library includes the:
• Predict block — To predict responses using the trained network specied through the block
parameter. This block allows loading of a pretrained network into the Simulink model from a MAT-
le or from a MATLAB
®
function.
For more information about working with the Predict block, see “Lane and Vehicle Detection in
Simulink Using Deep Learning”. To learn more about generating code for Simulink models
containing the Predict block, see “Code Generation for a Deep Learning Simulink Model that
Performs Lane and Vehicle Detection” (GPU Coder).
• Image Classier block — To classify data using a trained deep learning neural network specied
through the block parameter. This block allows loading of a pretrained network into the Simulink
model from a MAT-le or from a MATLAB function.
For more information about working with the Image Classier block, see “Classify ECG Signals in
Simulink Using Deep Learning”. To learn more about generating code for Simulink models
containing the Image Classier block, see “Code Generation for a Deep Learning Simulink Model
to Classify ECG Signals” (GPU Coder).
Experiment Manager: Train networks in parallel and using Bayesian
optimization
With Experiment Manager, you can now run multiple trials of an experiment in parallel. You can
also use Bayesian optimization to determine the best combination of hyperparameters for an
experiment.
Running the trials of an experiment in parallel allows you to try dierent training congurations at
the same time. You can also use MATLAB while the training is in progress. To run your experiment in
parallel, on the Experiment Manager toolstrip, click Use Parallel and then Run. Experiment
Manager starts the parallel pool and executes multiple simultaneous trials, depending on the number
of parallel workers available. Parallel execution requires Parallel Computing Toolbox™. For more
information, see “Use Experiment Manager to Train Networks in Parallel”.
Using Bayesian optimization provides an alternative to sweeping hyperparameters. To create an
experiment that uses Bayesian optimization, specify a range of values for each hyperparameter and
select a metric to maximize or minimize. When you click Run, Experiment Manager searches for a
combination of hyperparameters that optimizes the metric you selected. The combination used in
each trial is generated based on the results of the previous trials. You can train for a maximum length
of time or a maximum number of trials. Experiment Manager indicates the trial with the optimal
value for the selected metric. Bayesian optimization requires Statistics and Machine Learning
Toolbox™. Additionally, if you have Parallel Computing Toolbox, you can run multiple Bayesian
optimization trials at the same time. For more information, see “Tune Experiment Hyperparameters
by Using Bayesian Optimization”.
R2020b
1-2