File Exchange

image thumbnail

Deep Learning Tutorial Series

Download code and watch video series to learn and implement deep learning techniques

15 Ratings



View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

The code provides hands-on examples to implement convolutional neural networks (CNNs) for object recognition. The three demos have associated instructional videos that will allow for a complete tutorial experience to understand and implement deep learning techniques.
The demos include:
- Training a neural network from scratch
- Using a pre-trained model (transfer learning)
- Using a neural network as a feature extractor
The corresponding videos for the demos are located here:
The use of a GPU and Parallel Computing Toolbox™ is recommended when running the examples. Demo 3 requires Statistics and Machine Learning Toolbox™ in addition to the required products below.

Comments and Ratings (21)



>> DownloadCIFAR10
Downloading 174MB CIFAR-10 dataset...
Error using websave (line 106)
The error "Error copying data." occurred while communicating with URL

Error in DownloadCIFAR10 (line 13)

how can i correct this error

John Hu

Problem solved! -"Out of Memory on device...."
The trainNetWork() function contains opts parameter.
I depressed the 'MiniBatchSize' of opts from 128 to 64.
And also it took more time.
Good Course!

John Hu

When i ran the file Demo_TransferLearning.mlx at trainNetwork() function, it crashed, given the information "Out of Memory on device....".
I tried gpuDevice(1) statement, but it occurred again.
My GPU is GeForce GTX 965M with 4GB.
Should i config some parameters in Matlab?

Parul Sahi

In the program demo_TrainingFromScratch:
fc1 = fullyConnectedLayer(64,'BiasLearnRateFactor',2);
In the above code how are 64 neurons chosen in the fully connected layer.
fc1.Weights = single(randn([64 576])*0.1);
Also what does 576 indicate in the above code.


dgmcik (view profile)

alaa basel

confMat = confusionmat(imds_test.Labels, labels);
confMat = confMat./sum(confMat,2);
when i am runnig this part of code i got this massege(error using ./ matrix dimensions must agree ) what should i change to make it right

very helpful. I hope there will be something on regression in the future.

Is there any specific requirement for minimum version of MATLAB ? I am having errors saying undefined function, may be my MATLAB version don't has that function implemented.

Paresh Kamble

Hasan Erdem

Hasan Erdem

I think, you need to change convnet to net Demo_FeatureExtraction.

Kyle Cheng

thanks for your video. I have one question. For running this simulation, DO I need to have GPU on my computer?


xiao (view profile)

thanks for so excellent video. I have a question for the transfer learning demo. In Matlab, all layers except the last three(any other number) are extracted from the pretrained network, and the last three layers are replaced by new one. There are a few finetune ways, such as finetune the whole network, finetune the last classifier layer, or finetune from any specificed layer. So, I wonder what is the finetune ways in Matlab. finetune the whole network or finetune the last classifier layer? the trainNetwork function implements the retrain( finetune the whole network) ?

Hui Cui

I am sorry, THIS is the error I am getting:
Undefined function or variable 'convnet'.

Eleanor Li


Leow Bin


cui (view profile)


anggi nego



minor bug fix in third file, "Demo_FeatureExtraction.mlx" :
on line 1 & 2, variable 'net' changed to 'convnet'


+ Fixed typo in code.

MATLAB Release
MATLAB 9.2 (R2017a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video