【转帖】【面向代码】学习 Deep Learning(三)Convolution Neural Network(CNN)

今天是CNN的内容啦,CNN讲起来有些纠结,你可以事先看看convolutionpooling(subsampling),还有这篇:tornadomeet的博文

下面是那张经典的图:

======================================================================================================

打开\tests\test_example_CNN.m一观

[cpp] view plaincopyprint?

  1. cnn.layers = {
  2. struct(‘type‘, ‘i‘) %input layer
  3. struct(‘type‘, ‘c‘, ‘outputmaps‘, 6, ‘kernelsize‘, 5) %convolution layer
  4. struct(‘type‘, ‘s‘, ‘scale‘, 2) %sub sampling layer
  5. struct(‘type‘, ‘c‘, ‘outputmaps‘, 12, ‘kernelsize‘, 5) %convolution layer
  6. struct(‘type‘, ‘s‘, ‘scale‘, 2) %subsampling layer
  7. };
  8. cnn = cnnsetup(cnn, train_x, train_y);        //here!!!
  9. opts.alpha = 1;
  10. opts.batchsize = 50;
  11. opts.numepochs = 1;
  12. cnn = cnntrain(cnn, train_x, train_y, opts);  //here!!!
cnn.layers = {
    struct(‘type‘, ‘i‘) %input layer
    struct(‘type‘, ‘c‘, ‘outputmaps‘, 6, ‘kernelsize‘, 5) %convolution layer
    struct(‘type‘, ‘s‘, ‘scale‘, 2) %sub sampling layer
    struct(‘type‘, ‘c‘, ‘outputmaps‘, 12, ‘kernelsize‘, 5) %convolution layer
    struct(‘type‘, ‘s‘, ‘scale‘, 2) %subsampling layer
};
cnn = cnnsetup(cnn, train_x, train_y);        //here!!!
opts.alpha = 1;
opts.batchsize = 50;
opts.numepochs = 1;
cnn = cnntrain(cnn, train_x, train_y, opts);  //here!!!

似乎这次要复杂了一些啊,首先是layer,有三种,i是input,c是convolution,s是subsampling

‘c‘的outputmaps是convolution之后有多少张图,比如上(最上那张经典的))第一层convolution之后就有六个特征图

‘c‘的kernelsize 其实就是用来convolution的patch是多大

‘s‘的scale就是pooling的size为scale*scale的区域

接下来似乎就是常规思路了,cnnsetup()和cnntrain()啦,我们来看代码

\CNN\cnnsetup.m

主要是一些参数的作用的解释,详细的参看代码里的注释啊

[cpp] view plaincopyprint?

  1. function net = cnnsetup(net, x, y)
  2. inputmaps = 1;
  3. mapsize = size(squeeze(x(:, :, 1)));
  4. //尤其注意这几个循环的参数的设定
  5. //numel(net.layers)  表示有多少层
  6. for l = 1 : numel(net.layers)   //  layer
  7. if strcmp(net.layers{l}.type, ‘s‘)
  8. mapsize = mapsize / net.layers{l}.scale;
  9. //subsampling层的mapsize,最开始mapsize是每张图的大小28*28(这是第一次卷积后的结果,卷积前是32*32)
  10. //这里除以scale,就是pooling之后图的大小,这里为14*14
  11. assert(all(floor(mapsize)==mapsize), [‘Layer ‘ num2str(l) ‘ size must be integer. Actual: ‘ num2str(mapsize)]);
  12. for j = 1 : inputmaps //inputmap就是上一层有多少张特征图,通过初始化为1然后依层更新得到
  13. net.layers{l}.b{j} = 0;
  14. end
  15. end
  16. if strcmp(net.layers{l}.type, ‘c‘)
  17. mapsize = mapsize - net.layers{l}.kernelsize + 1;
  18. //这里的mapsize可以参见UFLDL里面的那张图下面的解释
  19. fan_out = net.layers{l}.outputmaps * net.layers{l}.kernelsize ^ 2;
  20. //隐藏层的大小,是一个(后层特征图数量)*(用来卷积的patch图的大小)
  21. for j = 1 : net.layers{l}.outputmaps  //  output map
  22. fan_in = inputmaps * net.layers{l}.kernelsize ^ 2;
  23. //对于每一个后层特征图,有多少个参数链到前层
  24. for i = 1 : inputmaps  //  input map
  25. net.layers{l}.k{i}{j} = (rand(net.layers{l}.kernelsize) - 0.5) * 2 * sqrt(6 / (fan_in + fan_out));
  26. end
  27. net.layers{l}.b{j} = 0;
  28. end
  29. inputmaps = net.layers{l}.outputmaps;
  30. end
  31. end
  32. // ‘onum‘ is the number of labels, that‘s why it is calculated using size(y, 1). If you have 20 labels so the output of the network will be 20 neurons.
  33. // ‘fvnum‘ is the number of output neurons at the last layer, the layer just before the output layer.
  34. // ‘ffb‘ is the biases of the output neurons.
  35. // ‘ffW‘ is the weights between the last layer and the output neurons. Note that the last layer is fully connected to the output layer, that‘s why the size of the weights is (onum * fvnum)
  36. fvnum = prod(mapsize) * inputmaps;
  37. onum = size(y, 1);
  38. //这里是最后一层神经网络的设定
  39. net.ffb = zeros(onum, 1);
  40. net.ffW = (rand(onum, fvnum) - 0.5) * 2 * sqrt(6 / (onum + fvnum));
  41. end
function net = cnnsetup(net, x, y)
    inputmaps = 1;
    mapsize = size(squeeze(x(:, :, 1)));
    //尤其注意这几个循环的参数的设定
    //numel(net.layers)  表示有多少层
    for l = 1 : numel(net.layers)   //  layer
        if strcmp(net.layers{l}.type, ‘s‘)
            mapsize = mapsize / net.layers{l}.scale;
            //subsampling层的mapsize,最开始mapsize是每张图的大小28*28(这是第一次卷积后的结果,卷积前是32*32)
            //这里除以scale,就是pooling之后图的大小,这里为14*14
            assert(all(floor(mapsize)==mapsize), [‘Layer ‘ num2str(l) ‘ size must be integer. Actual: ‘ num2str(mapsize)]);
            for j = 1 : inputmaps //inputmap就是上一层有多少张特征图,通过初始化为1然后依层更新得到
                net.layers{l}.b{j} = 0;
            end
        end
        if strcmp(net.layers{l}.type, ‘c‘)
            mapsize = mapsize - net.layers{l}.kernelsize + 1;
            //这里的mapsize可以参见UFLDL里面的那张图下面的解释
            fan_out = net.layers{l}.outputmaps * net.layers{l}.kernelsize ^ 2;
            //隐藏层的大小,是一个(后层特征图数量)*(用来卷积的patch图的大小)
            for j = 1 : net.layers{l}.outputmaps  //  output map
                fan_in = inputmaps * net.layers{l}.kernelsize ^ 2;
                //对于每一个后层特征图,有多少个参数链到前层
                for i = 1 : inputmaps  //  input map
                    net.layers{l}.k{i}{j} = (rand(net.layers{l}.kernelsize) - 0.5) * 2 * sqrt(6 / (fan_in + fan_out));
                end
                net.layers{l}.b{j} = 0;
            end
            inputmaps = net.layers{l}.outputmaps;
        end
    end
    // ‘onum‘ is the number of labels, that‘s why it is calculated using size(y, 1). If you have 20 labels so the output of the network will be 20 neurons.
    // ‘fvnum‘ is the number of output neurons at the last layer, the layer just before the output layer.
    // ‘ffb‘ is the biases of the output neurons.
    // ‘ffW‘ is the weights between the last layer and the output neurons. Note that the last layer is fully connected to the output layer, that‘s why the size of the weights is (onum * fvnum)
    fvnum = prod(mapsize) * inputmaps;
    onum = size(y, 1);
    //这里是最后一层神经网络的设定
    net.ffb = zeros(onum, 1);
    net.ffW = (rand(onum, fvnum) - 0.5) * 2 * sqrt(6 / (onum + fvnum));
end

\CNN\cnntrain.m

cnntrain就和nntrain是一个节奏了:

[cpp] view plaincopyprint?

  1. net = cnnff(net, batch_x);
  2. net = cnnbp(net, batch_y);
  3. net = cnnapplygrads(net, opts);
            net = cnnff(net, batch_x);
            net = cnnbp(net, batch_y);
            net = cnnapplygrads(net, opts);

cnntrain是用back propagation来计算gradient的,我们一次来看这三个函数:

cnnff.m

这部分计算还比较简单,可以说是有迹可循,大家最好看看tornadomeet的博文的步骤,说得比较清楚

[cpp] view plaincopyprint?

  1. function net = cnnff(net, x)
  2. n = numel(net.layers);
  3. net.layers{1}.a{1} = x;
  4. inputmaps = 1;
  5. for l = 2 : n   //  for each layer
  6. if strcmp(net.layers{l}.type, ‘c‘)
  7. //  !!below can probably be handled by insane matrix operations
  8. for j = 1 : net.layers{l}.outputmaps   //  for each output map
  9. //  create temp output map
  10. z = zeros(size(net.layers{l - 1}.a{1}) - [net.layers{l}.kernelsize - 1 net.layers{l}.kernelsize - 1 0]);
  11. for i = 1 : inputmaps   //  for each input map
  12. //  convolve with corresponding kernel and add to temp output map
  13. //  做卷积,参考UFLDL,这里是对每一个input的特征图做一次卷积,再加起来
  14. z = z + convn(net.layers{l - 1}.a{i}, net.layers{l}.k{i}{j}, ‘valid‘);
  15. end
  16. //  add bias, pass through nonlinearity
  17. //  加入bias
  18. net.layers{l}.a{j} = sigm(z + net.layers{l}.b{j});
  19. end
  20. //  set number of input maps to this layers number of outputmaps
  21. inputmaps = net.layers{l}.outputmaps;
  22. elseif strcmp(net.layers{l}.type, ‘s‘)
  23. //  downsample
  24. for j = 1 : inputmaps
  25. //这里有点绕绕的,它是新建了一个patch来做卷积,但我们要的是pooling,所以它跳着把结果读出来,步长为scale
  26. //这里做的是mean-pooling
  27. z = convn(net.layers{l - 1}.a{j}, ones(net.layers{l}.scale) / (net.layers{l}.scale ^ 2), ‘valid‘);   //  !! replace with variable
  28. net.layers{l}.a{j} = z(1 : net.layers{l}.scale : end, 1 : net.layers{l}.scale : end, :);
  29. end
  30. end
  31. end
  32. //  收纳到一个vector里面,方便后面用~~
  33. //  concatenate all end layer feature maps into vector
  34. net.fv = [];
  35. for j = 1 : numel(net.layers{n}.a)
  36. sa = size(net.layers{n}.a{j});
  37. net.fv = [net.fv; reshape(net.layers{n}.a{j}, sa(1) * sa(2), sa(3))];
  38. end
  39. //  最后一层的perceptrons,数据识别的结果
  40. net.o = sigm(net.ffW * net.fv + repmat(net.ffb, 1, size(net.fv, 2)));
  41. end
function net = cnnff(net, x)
    n = numel(net.layers);
    net.layers{1}.a{1} = x;
    inputmaps = 1;

    for l = 2 : n   //  for each layer
        if strcmp(net.layers{l}.type, ‘c‘)
            //  !!below can probably be handled by insane matrix operations
            for j = 1 : net.layers{l}.outputmaps   //  for each output map
                //  create temp output map
                z = zeros(size(net.layers{l - 1}.a{1}) - [net.layers{l}.kernelsize - 1 net.layers{l}.kernelsize - 1 0]);
                for i = 1 : inputmaps   //  for each input map
                    //  convolve with corresponding kernel and add to temp output map
                    //  做卷积,参考UFLDL,这里是对每一个input的特征图做一次卷积,再加起来
                    z = z + convn(net.layers{l - 1}.a{i}, net.layers{l}.k{i}{j}, ‘valid‘);
                end
                //  add bias, pass through nonlinearity
                //  加入bias
                net.layers{l}.a{j} = sigm(z + net.layers{l}.b{j});
            end
            //  set number of input maps to this layers number of outputmaps
            inputmaps = net.layers{l}.outputmaps;
        elseif strcmp(net.layers{l}.type, ‘s‘)
            //  downsample
            for j = 1 : inputmaps
                //这里有点绕绕的,它是新建了一个patch来做卷积,但我们要的是pooling,所以它跳着把结果读出来,步长为scale
                //这里做的是mean-pooling
                z = convn(net.layers{l - 1}.a{j}, ones(net.layers{l}.scale) / (net.layers{l}.scale ^ 2), ‘valid‘);   //  !! replace with variable
                net.layers{l}.a{j} = z(1 : net.layers{l}.scale : end, 1 : net.layers{l}.scale : end, :);
            end
        end
    end
    //  收纳到一个vector里面,方便后面用~~
    //  concatenate all end layer feature maps into vector
    net.fv = [];
    for j = 1 : numel(net.layers{n}.a)
        sa = size(net.layers{n}.a{j});
        net.fv = [net.fv; reshape(net.layers{n}.a{j}, sa(1) * sa(2), sa(3))];
    end
    //  最后一层的perceptrons,数据识别的结果
    net.o = sigm(net.ffW * net.fv + repmat(net.ffb, 1, size(net.fv, 2)));

end

cnnbp.m

这个就哭了,代码有些纠结,不得已又找资料看啊,《Notes on Convolutional Neural Networks》要好一些

只是这个toolbox的代码和《Notes on Convolutional Neural Networks》里有些不一样的是这个toolbox在subsampling(也就是pooling层)没有加sigmoid激活函数,只是单纯地pooling了一下,所以这地方还需仔细辨别,这个toolbox里的subsampling是不用计算gradient的,而在Notes里是计算了的

还有这个toolbox没有Combinations of Feature Maps,也就是tornadomeet的博文里这张表格:

具体就去看看上面这篇论文吧

然后就看代码吧:

[cpp] view plaincopyprint?

  1. function net = cnnbp(net, y)
  2. n = numel(net.layers);
  3. //  error
  4. net.e = net.o - y;
  5. //  loss function
  6. net.L = 1/2* sum(net.e(:) .^ 2) / size(net.e, 2);
  7. //从最后一层的error倒推回来deltas
  8. //和神经网络的bp有些类似
  9. ////  backprop deltas
  10. net.od = net.e .* (net.o .* (1 - net.o));   //  output delta
  11. net.fvd = (net.ffW‘ * net.od);              //  feature vector delta
  12. if strcmp(net.layers{n}.type, ‘c‘)         //  only conv layers has sigm function
  13. net.fvd = net.fvd .* (net.fv .* (1 - net.fv));
  14. end
  15. //和神经网络类似,参看神经网络的bp
  16. //  reshape feature vector deltas into output map style
  17. sa = size(net.layers{n}.a{1});
  18. fvnum = sa(1) * sa(2);
  19. for j = 1 : numel(net.layers{n}.a)
  20. net.layers{n}.d{j} = reshape(net.fvd(((j - 1) * fvnum + 1) : j * fvnum, :), sa(1), sa(2), sa(3));
  21. end
  22. //这是算delta的步骤
  23. //这部分的计算参看Notes on Convolutional Neural Networks,其中的变化有些复杂
  24. //和这篇文章里稍微有些不一样的是这个toolbox在subsampling(也就是pooling层)没有加sigmoid激活函数
  25. //所以这地方还需仔细辨别
  26. //这这个toolbox里的subsampling是不用计算gradient的,而在上面那篇note里是计算了的
  27. for l = (n - 1) : -1 : 1
  28. if strcmp(net.layers{l}.type, ‘c‘)
  29. for j = 1 : numel(net.layers{l}.a)
  30. net.layers{l}.d{j} = net.layers{l}.a{j} .* (1 - net.layers{l}.a{j}) .* (expand(net.layers{l + 1}.d{j}, [net.layers{l + 1}.scale net.layers{l + 1}.scale 1]) / net.layers{l + 1}.scale ^ 2);
  31. end
  32. elseif strcmp(net.layers{l}.type, ‘s‘)
  33. for i = 1 : numel(net.layers{l}.a)
  34. z = zeros(size(net.layers{l}.a{1}));
  35. for j = 1 : numel(net.layers{l + 1}.a)
  36. z = z + convn(net.layers{l + 1}.d{j}, rot180(net.layers{l + 1}.k{i}{j}), ‘full‘);
  37. end
  38. net.layers{l}.d{i} = z;
  39. end
  40. end
  41. end
  42. //参见paper,注意这里只计算了‘c‘层的gradient,因为只有这层有参数
  43. ////  calc gradients
  44. for l = 2 : n
  45. if strcmp(net.layers{l}.type, ‘c‘)
  46. for j = 1 : numel(net.layers{l}.a)
  47. for i = 1 : numel(net.layers{l - 1}.a)
  48. net.layers{l}.dk{i}{j} = convn(flipall(net.layers{l - 1}.a{i}), net.layers{l}.d{j}, ‘valid‘) / size(net.layers{l}.d{j}, 3);
  49. end
  50. net.layers{l}.db{j} = sum(net.layers{l}.d{j}(:)) / size(net.layers{l}.d{j}, 3);
  51. end
  52. end
  53. end
  54. //最后一层perceptron的gradient的计算
  55. net.dffW = net.od * (net.fv)‘ / size(net.od, 2);
  56. net.dffb = mean(net.od, 2);
  57. function X = rot180(X)
  58. X = flipdim(flipdim(X, 1), 2);
  59. end
  60. end
function net = cnnbp(net, y)
    n = numel(net.layers);
    //  error
    net.e = net.o - y;
    //  loss function
    net.L = 1/2* sum(net.e(:) .^ 2) / size(net.e, 2);
    //从最后一层的error倒推回来deltas
    //和神经网络的bp有些类似
    ////  backprop deltas
    net.od = net.e .* (net.o .* (1 - net.o));   //  output delta
    net.fvd = (net.ffW‘ * net.od);              //  feature vector delta
    if strcmp(net.layers{n}.type, ‘c‘)         //  only conv layers has sigm function
        net.fvd = net.fvd .* (net.fv .* (1 - net.fv));
    end
    //和神经网络类似,参看神经网络的bp

    //  reshape feature vector deltas into output map style
    sa = size(net.layers{n}.a{1});
    fvnum = sa(1) * sa(2);
    for j = 1 : numel(net.layers{n}.a)
        net.layers{n}.d{j} = reshape(net.fvd(((j - 1) * fvnum + 1) : j * fvnum, :), sa(1), sa(2), sa(3));
    end
    //这是算delta的步骤
    //这部分的计算参看Notes on Convolutional Neural Networks,其中的变化有些复杂
    //和这篇文章里稍微有些不一样的是这个toolbox在subsampling(也就是pooling层)没有加sigmoid激活函数
    //所以这地方还需仔细辨别
    //这这个toolbox里的subsampling是不用计算gradient的,而在上面那篇note里是计算了的
    for l = (n - 1) : -1 : 1
        if strcmp(net.layers{l}.type, ‘c‘)
            for j = 1 : numel(net.layers{l}.a)
                net.layers{l}.d{j} = net.layers{l}.a{j} .* (1 - net.layers{l}.a{j}) .* (expand(net.layers{l + 1}.d{j}, [net.layers{l + 1}.scale net.layers{l + 1}.scale 1]) / net.layers{l + 1}.scale ^ 2);
            end
        elseif strcmp(net.layers{l}.type, ‘s‘)
            for i = 1 : numel(net.layers{l}.a)
                z = zeros(size(net.layers{l}.a{1}));
                for j = 1 : numel(net.layers{l + 1}.a)
                     z = z + convn(net.layers{l + 1}.d{j}, rot180(net.layers{l + 1}.k{i}{j}), ‘full‘);
                end
                net.layers{l}.d{i} = z;
            end
        end
    end
    //参见paper,注意这里只计算了‘c‘层的gradient,因为只有这层有参数
    ////  calc gradients
    for l = 2 : n
        if strcmp(net.layers{l}.type, ‘c‘)
            for j = 1 : numel(net.layers{l}.a)
                for i = 1 : numel(net.layers{l - 1}.a)
                    net.layers{l}.dk{i}{j} = convn(flipall(net.layers{l - 1}.a{i}), net.layers{l}.d{j}, ‘valid‘) / size(net.layers{l}.d{j}, 3);
                end
                net.layers{l}.db{j} = sum(net.layers{l}.d{j}(:)) / size(net.layers{l}.d{j}, 3);
            end
        end
    end
    //最后一层perceptron的gradient的计算
    net.dffW = net.od * (net.fv)‘ / size(net.od, 2);
    net.dffb = mean(net.od, 2);

    function X = rot180(X)
        X = flipdim(flipdim(X, 1), 2);
    end
end

cnnapplygrads.m

这部分就轻松了,已经有grads了,依次进行梯度更新就好了

[cpp] view plaincopyprint?

  1. function net = cnnapplygrads(net, opts)
  2. for l = 2 : numel(net.layers)
  3. if strcmp(net.layers{l}.type, ‘c‘)
  4. for j = 1 : numel(net.layers{l}.a)
  5. for ii = 1 : numel(net.layers{l - 1}.a)
  6. net.layers{l}.k{ii}{j} = net.layers{l}.k{ii}{j} - opts.alpha * net.layers{l}.dk{ii}{j};
  7. end
  8. net.layers{l}.b{j} = net.layers{l}.b{j} - opts.alpha * net.layers{l}.db{j};
  9. end
  10. end
  11. end
  12. net.ffW = net.ffW - opts.alpha * net.dffW;
  13. net.ffb = net.ffb - opts.alpha * net.dffb;
  14. end
function net = cnnapplygrads(net, opts)
    for l = 2 : numel(net.layers)
        if strcmp(net.layers{l}.type, ‘c‘)
            for j = 1 : numel(net.layers{l}.a)
                for ii = 1 : numel(net.layers{l - 1}.a)
                    net.layers{l}.k{ii}{j} = net.layers{l}.k{ii}{j} - opts.alpha * net.layers{l}.dk{ii}{j};
                end
                net.layers{l}.b{j} = net.layers{l}.b{j} - opts.alpha * net.layers{l}.db{j};
            end
        end
    end

    net.ffW = net.ffW - opts.alpha * net.dffW;
    net.ffb = net.ffb - opts.alpha * net.dffb;
end

cnntest.m

好吧,我们得知道最后结果怎么来啊

[cpp] view plaincopyprint?

  1. function [er, bad] = cnntest(net, x, y)
  2. //  feedforward
  3. net = cnnff(net, x);
  4. [~, h] = max(net.o);
  5. [~, a] = max(y);
  6. bad = find(h ~= a);
  7. er = numel(bad) / size(y, 2);
  8. end
function [er, bad] = cnntest(net, x, y)
    //  feedforward
    net = cnnff(net, x);
    [~, h] = max(net.o);
    [~, a] = max(y);
    bad = find(h ~= a);

    er = numel(bad) / size(y, 2);
end

就是这样~~cnnff一次后net.o就是结果

总结

just code !

这是一个89年的模型啊~~~,最近还和RBM结合起来了,做了一个Imagenet的最好成绩(是这个吧?):

Alex Krizhevsky.ImageNet Classification with Deep  Convolutional Neural Networks. Video and Slides, 2012                http://www.cs.utoronto.ca/~rsalakhu/papers/dbm.pdf

【参考】:

Deep learning:三十八(Stacked CNN简单介绍)

UFLDL

Notes on Convolutional Neural Networks

Convolutional Neural Networks (LeNet)】  这是deeplearning 的theano库的

时间: 2024-08-28 10:46:37

【转帖】【面向代码】学习 Deep Learning(三)Convolution Neural Network(CNN)的相关文章

Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1

3.Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.1 http://blog.csdn.net/sunbow0 Spark MLlib Deep Learning工具箱,是根据现有深度学习教程<UFLDL教程>中的算法,在SparkMLlib中的实现.具体Spark MLlib Deep Learning(深度学习)目录结构: 第一章Neural Net(NN) 1.源码 2.源码解析 3.实例 第二章D

【深度学习Deep Learning】资料大全

转载:http://www.cnblogs.com/charlotte77/p/5485438.html 最近在学深度学习相关的东西,在网上搜集到了一些不错的资料,现在汇总一下: Free Online Books Deep Learning66 by Yoshua Bengio, Ian Goodfellow and Aaron Courville Neural Networks and Deep Learning42 by Michael Nielsen Deep Learning27 by

机器学习(Machine Learning)&amp;amp;深度学习(Deep Learning)资料

机器学习(Machine Learning)&深度学习(Deep Learning)资料 機器學習.深度學習方面不錯的資料,轉載. 原作:https://github.com/ty4z2008/Qix/blob/master/dl.md 原作作者會不斷更新.本文更新至2014-12-21 <Brief History of Machine Learning> 介绍:这是一篇介绍机器学习历史的文章,介绍非常全面.从感知机.神经网络.决策树.SVM.Adaboost到随机森林.Deep L

Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.2

3.Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.2 http://blog.csdn.net/sunbow0 第三章Convolution Neural Network (卷积神经网络) 2基础及源码解析 2.1 Convolution Neural Network卷积神经网络基础知识 1)基础知识: 自行google,百度,基础方面的非常多,随便看看就可以,只是很多没有把细节说得清楚和明白: 能把细节说清

机器学习(Machine Learning)&amp;深度学习(Deep Learning)资料

机器学习(Machine Learning)&深度学习(Deep Learning)资料 <Brief History of Machine Learning> 介绍:这是一篇介绍机器学习历史的文章,介绍很全面,从感知机.神经网络.决策树.SVM.Adaboost到随机森林.Deep Learning. <Deep Learning in Neural Networks: An Overview> 介绍:这是瑞士人工智能实验室Jurgen Schmidhuber写的最新版本

Spark MLlib Deep Learning Convolution Neural Network (深度学习-卷积神经网络)3.3

3.Spark MLlib Deep Learning Convolution Neural Network(深度学习-卷积神经网络)3.3 http://blog.csdn.net/sunbow0 第三章Convolution Neural Network (卷积神经网络) 3实例 3.1 测试数据 按照上例数据,或者新建图片识别数据. 3.2 CNN实例 //2 测试数据 Logger.getRootLogger.setLevel(Level.WARN) valdata_path="/use

【转载】浅谈深度学习(Deep Learning)的基本思想和方法

浅谈深度学习(Deep Learning)的基本思想和方法 分类: 机器学习 信息抽取 Deep Learning2013-01-07 22:18 25010人阅读 评论(11) 收藏 举报 深度学习(Deep Learning),又叫Unsupervised Feature Learning或者Feature Learning,是目前非常热的一个研究主题. 本文将主要介绍Deep Learning的基本思想和常用的方法. 一. 什么是Deep Learning? 实际生活中,人们为了解决一个问

【转载】机器学习——深度学习(Deep Learning)

机器学习——深度学习(Deep Learning) 分类: Machine Learning2012-08-04 09:49 142028人阅读 评论(70) 收藏 举报 algorithmclassificationfeaturesfunctionhierarchy Deep Learning是机器学习中一个非常接近AI的领域,其动机在于建立.模拟人脑进行分析学习的神经网络,最近研究了机器学习中一些深度学习的相关知识,本文给出一些很有用的资料和心得. Key Words:有监督学习与无监督学习

机器学习——深度学习(Deep Learning)

Deep Learning是机器学习中一个非常接近AI的领域,其动机在于建立.模拟人脑进行分析学习的神经网络,最近研究了机器学习中一些深度学习的相关知识,本文给出一些很有用的资料和心得. Key Words:有监督学习与无监督学习,分类.回归,密度估计.聚类,深度学习,Sparse DBN, 1. 有监督学习和无监督学习 给定一组数据(input,target)为Z=(X,Y). 有监督学习:最常见的是regression & classification. regression:Y是实数vec