How to onstruct a deep network from Layers and meta variables

2 次查看(过去 30 天)
I have a pretrained CNN model(*.mat) downloaded from the internet, contains two Matlab variables "layers" and "meta".
May i have ability to construct network(net) from these two variables to pass my dataset without training?

回答(1 个)

Ayush Aniket
Ayush Aniket 2025-9-2,9:13
You can use a pretrained CNN model from a .mat file containing layers and meta to process your dataset without retraining but it depends on how the model was saved and structured.
If layers is a valid array of MATLAB deep learning layers (e.g., created using layerGraph or a simple array of layers), you can reconstruct the network using:
net = assembleNetwork(layers);
This creates a SeriesNetwork or DAGNetwork depending on the structure. You can then use functions like classify, predict, or activations to pass data through the network.
Once the network is assembled, you can use it directly:
predictions = classify(net, inputData);
No training is needed if the weights are already embedded in the layers structure.
If the layers variable is not compatible with assembleNetwork, it might be from a different framework (e.g., MatConvNet). In that case, you’ll need to manually convert it or use the original toolbox that created it.

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by