MatLab深度学习介绍

0.起因

以前注册了MathWorks官网,前几天发了封邮件给我,介绍深度学习的,我就点进去看看,发现内容蛮好的。

就跟着学了两天,写一下感想。

1.深度学习介绍

公司官网有个很好的深度学习(Deep Learning)介绍文档。

他们在视频中对深度学习的解释就是:

Deep Learning is a machine learning technique that learning features and tasks directly from data.

深度学习是机器学习的一种,从数据中直接学习特性和功能。

深度学习使用卷积神经网络(CNN,convolution neural network )方式来处理数据

MatLab视频地址:Introduction to Deep Learning

下面文档下载地址:https://cn.mathworks.com/campaigns/products/offer/deep-learning-with-matlab.html

百度网盘:https://pan.baidu.com/s/1nwK3mp7

2.使用AlexNet识别物体

在MatLab中下载并安装这个组件,然后调用webcam使用snapshot函数捕获图像

再使用classify函数将图像放入alexnet中识别,会返回识别物体的种类名称

其中需要安装两个组件,webcam下载地址,alexnet下载地址

(需要将下载好的组件放在Matlab中点击安装,比较麻烦,还需要登录,最好注册一个账号)

MatLab视频地址:Deep Learning with MATLAB

代码如下:

clear

camera = webcam;   %connect webcamera
                   %https://cn.mathworks.com/matlabcentral/fileexchange/45182-matlab-support-package-for-usb-webcams     
nnet = alexnet;    %alax.net data from network
                   %https://cn.mathworks.com/matlabcentral/fileexchange/59133-neural-network-toolbox-tm--model-for-alexnet-network
while(true)
    picture = camera.snapshot;  %get camera shot
    picture = imresize(picture,[227,227]);  %resize picture, why 227?
    label = classify(nnet, picture);    %find specific neuron with alexnet
    image(picture); %show picture
    title(char(label)); %title result
    drawnow;    %get last picture
end;

 

3.感想

虽然不知道很多概念,没搞懂原理,但总算了解了深度学习,顺便拿matlab练练手了,还是不错的。

posted on 2018-02-08 17:12  hujun1992  阅读(1794)  评论(0编辑  收藏  举报

导航