• 大小: 3.11MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-16
  • 语言: Matlab
  • 标签: CNN  车牌  Matlab  

资源简介

在lenet5基础上修改;增加收集图片功能 字符 A的相关图片 字符B的 先关图片.... ,调用训练函数;本程序已经训练好的可以直接对图片进行测试

资源截图

代码片段和文件信息

function checkgrads(netxy)
epsilon = 1e-4;
er      = 1e-8;
n = numel(net.layers);
for l = n : -1 : 2
    if strcmp(net.layers{l}.type‘Soft‘)
        for j = 1 : numel(net.layers{l}.b)
            net_m = net; net_p = net;
            net_p.layers{l}.b(j) = net_m.layers{l}.b(j) + epsilon;
            net_m.layers{l}.b(j) = net_m.layers{l}.b(j) - epsilon;
            net_m = cnnff(net_mx);net_m = cnnbp(net_my);
            net_p = cnnff(net_px);net_p = cnnbp(net_py);
            d = (net_p.L - net_m.L) / (2 * epsilon);
            e = abs(d - net.layers{l}.db(j));
            if e > er
                error(‘numrical graddient checking failed at softb‘);
            end
        end
        
        for i = 1 : size(net.layers{l}.w1)
            for j = 1 : size(net.layers{l}.w2)
                net_m = net; net_p = net;
                net_p.layers{l}.w(ij) = net_p.layers{l}.w(ij) + epsilon;
                net_m.layers{l}.w(ij) = net_m.layers{l}.w(ij) - epsilon;
                net_m = cnnff(net_mx); net_m = cnnbp(net_my);
                net_p = cnnff(net_px); net_p = cnnbp(net_py);
                d = (net_p.L - net_m.L)/(2*epsilon);
                e = abs(d - net.layers{l}.dw(ij));
                if e > er
                    error(‘numrical graddient checking faild at softw‘);
                end
            end
        end
    end
    
    if strcmp(net.layers{l}.type‘F6‘)
        for j = 1 : size(net.layers{l}.b1)
            net_m = net;net_p = net;
            net_p.layers{l}.b(j) = net_p.layers{l}.b(j) + epsilon;
            net_m.layers{l}.b(j) = net_m.layers{l}.b(j) - epsilon;
            net_p = cnnff(net_px); net_p = cnnbp(net_py);
            net_m = cnnff(net_mx); net_m = cnnbp(net_my);
            %db = net.layers{l}.db(j);
            d = (net_p.L - net_m.L) / (2 * epsilon);
            e = abs(d - net.layers{l}.db(j));
            if e > er
                error(‘numrical graddient checking failed at F6b‘);
            end
        end
        for i = 1 : size(net.layers{l}.w1)
            for j = 1 : size(net.layers{l}.w2)
                net_m = net;net_p = net;
                net_p.layers{l}.w(ij) = net_p.layers{l}.w(ij) + epsilon;
                net_m.layers{l}.w(ij) = net_m.layers{l}.w(ij) - epsilon;
                net_p = cnnff(net_px);net_p =cnnbp(net_py);
                net_m = cnnff(net_mx);net_m = cnnbp(net_my);
                d = (net_p.L - net_m.L) / (2 * epsilon);
                e = abs(d - net.layers{l}.dw(ij));
                if e > er
                    error(‘numrical gradient checking failed at F6w‘);
                end
            end
        end
    end
    
    if strcmp(net.layers{l}.type‘C5‘)
        for i = 1 : size(net.layers{l}.w1)
            for j = 1 : size(net.layers{l}.w2)
                net_m = net;net_p = net;
                net_p.layers{l}.w(ij) = net_p.layers{l}.w(ij) + epsilo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7089  2015-01-15 09:38  Lenet5_EasyPR_D\checkgrads.m

     文件        858  2015-01-13 16:08  Lenet5_EasyPR_D\cnnapplyGrads.m

     文件       3268  2016-04-06 09:23  Lenet5_EasyPR_D\cnnbp.m

     文件       2475  2015-01-15 11:03  Lenet5_EasyPR_D\cnnff.m

     文件        823  2015-01-15 09:37  Lenet5_EasyPR_D\cnnTrain.m

     文件       1369  2016-04-06 09:16  Lenet5_EasyPR_D\collectImgToMat.m

     文件    3137044  2016-04-06 09:27  Lenet5_EasyPR_D\easyPR_chinaData.mat

     文件       1958  2015-01-13 09:37  Lenet5_EasyPR_D\expand.m

     文件         80  2015-01-13 15:01  Lenet5_EasyPR_D\flipall.m

     文件        212  2016-04-06 09:19  Lenet5_EasyPR_D\iLbPrintData.mat

     文件        308  2016-04-06 09:19  Lenet5_EasyPR_D\iLbsData.mat

     文件       2595  2015-01-13 14:46  Lenet5_EasyPR_D\initialParameters.m

     文件        360  2016-04-05 19:01  Lenet5_EasyPR_D\loadEasyPRImages.m

     文件        218  2016-04-04 19:27  Lenet5_EasyPR_D\loadEasyPrLabels.m

     文件        957  2016-04-06 09:08  Lenet5_EasyPR_D\LoadFileImg.asv

     文件        959  2016-04-06 09:15  Lenet5_EasyPR_D\LoadFileImg.m

     文件        811  2013-09-25 15:14  Lenet5_EasyPR_D\loadMNISTImages.m

     文件        516  2013-09-25 15:14  Lenet5_EasyPR_D\loadMNISTLabels.m

     文件         60  2015-01-13 14:25  Lenet5_EasyPR_D\sigm.m

     文件        300  2016-04-06 09:19  Lenet5_EasyPR_D\strLbPrintData.mat

     文件        834  2016-04-05 18:38  Lenet5_EasyPR_D\testLenet.m

     文件        566  2016-04-06 09:28  Lenet5_EasyPR_D\testLenetEasyPR.m

     文件        886  2016-04-05 11:36  Lenet5_EasyPR_D\trainLenet.m

     文件       1082  2016-04-06 09:20  Lenet5_EasyPR_D\trainLenet_EasyPRWord.m

     文件        588  2016-06-02 09:36  Lenet5_EasyPR_D\使用说明.txt

     文件        868  2014-08-23 14:44  Lenet5_EasyPR_D\测试文字\300-1.jpg

     文件        709  2014-08-23 14:44  Lenet5_EasyPR_D\测试文字\304-5.jpg

     文件        721  2014-08-23 14:44  Lenet5_EasyPR_D\测试文字\311-7.jpg

     文件        648  2014-08-23 14:44  Lenet5_EasyPR_D\测试文字\312-8.jpg

     文件        805  2015-03-19 11:58  Lenet5_EasyPR_D\测试文字\319_sun_b_4.jpg

............此处省略139个文件信息

评论

共有 条评论