当前位置: 首页 > news >正文

备案空壳网站教育机构退费纠纷找谁

备案空壳网站,教育机构退费纠纷找谁,武昌做网站jw100,网站前置审批证书惦记cnn很久了,一直搞机器视觉,走不出来,现在megauging已经实现,说明书也写了不少,该突破的突破了,该改进的也改进了,一个心病治好了,有空把人工智能在机器视觉上的延伸,…

惦记cnn很久了,一直搞机器视觉,走不出来,现在megauging已经实现,说明书也写了不少,该突破的突破了,该改进的也改进了,一个心病治好了,有空把人工智能在机器视觉上的延伸,补一补。自己也是一直认为,人工智能是在机器视觉上发展起来的,所以做这些事情,也是顺理成章。

前头有几篇自己研究bpnet的资料,不成气候,现在可以补齐。

后面的突破,那些个前面bpnet的公式推导仍然是必不可少,我这里就省略了。

网上看到有c++手写数字识别(基于mnist数据集),顺便翻译成c#,但没有成功,直觉上估计是自己在翻译二维数组过程中有问题,因为数学的推导,我已经反复核对过了!

c++有兴趣的可以参考:利用c++编写bp神经网络实现手写数字识别详解 - AlphaInf - 博客园

后来发现,直觉不对,二维数组没错,错了两处:

1,c++和c#的random函数使用不同

2,d【10】这个数组初始化不对

然后,我觉得学习的时间太长,就改进了一下,具体如下:

28*28的图像,使用3*3的高斯核平滑,然后隔行隔列取像素,形成14*14的图像,然后全连接:

196-》128-》10,或者196-》80-》10,训练结果都很好,自己要求不很高,达到95分就行。

下面是自己的c#代码:

  double learnRate = 0.2f; //学习率 
        int n = 196; //输入层点个数 
        int p = 128; //隐藏层节点个数 
        int q = 10; //输出层节点个数 

        //与推导公式保持一致 
        //double x[n],hi[p],ho[p],yi[q],yo[q],d[q];
        double[] xI = new double[14*14];
        double[] hI = new double[128];
        double[] hO = new double[128];

        double[] yi = new double[10];
        double[] yO = new double[10];
        //所训练的网络,采用两个矩阵表示 
        double[,] w1 = new double[196, 128];
        double[,] w2 = new double[128, 10];

  void init()
        {
            Random ran = new Random();
          
            for (int i = 0; i < n; i++)
                for (int j = 0; j < p; j++)
                {
                 
                    //  w1[i, j] = 0.1;
                 

                     w1[i,j]  = ran.Next(-100, 100)/100f;
                  //  w1[i][j] = ran.Next(0, 65535) % 10 / 5f - 1;
                }
            //zhege zhengfu yi zhijian henmiao20240912
           
            for (int i = 0; i < p; i++)
                for (int j = 0; j < q; j++)
                {
                   
                    // w2[i, j] = 0.1;


                    w2[i,j] = ran.Next(-100, 100) / 100f;
                    // w2[i][j] = ran.Next(0, 65535) % 10 / 5f - 1;
                }

}

以上初始化要说明的是:权重都初始化为【-1,1】之间的随机数,图像每个像素除以255,图像每个像素归一化到【0,1】

   int[] d = new int[10];
        int[] last = new int[60000];
        //激活函数 
        public double sigmoid(double x)
        {
            return 1 / (1f + Math.Exp(-x));
        }
        //前向传播函数 
        public void forward()
        {
            //计算hi前需要对其进行清空 
            //  memset(hi, 0, sizeof(hi));
            hI = new double[128];
            //通过w1计算输入层-隐藏层输入节点 
            for (int i = 0; i < n; i++)//196
                for (int j = 0; j < p; j++)//128

                    hI[j] += xI[i] * w1[i,j];

            //通过激活函数对隐藏层进行计算 
            for (int i = 0; i < p; i++)
                //hO[i] = sigmoid(hI[i]+bh[i]);
                hO[i] = sigmoid(hI[i] );
            计算yi前需要对其进行清空 
            //memset(yi, 0, sizeof(yi));
            yi = new double[10];
            //通过w2计算隐藏层-输出层
            for (int i = 0; i < p; i++)
                for (int j = 0; j < q; j++)

                    yi[j] += hO[i] * w2[i,j];

            //通过激活函数求yo
            for (int i = 0; i < q; i++)
                //yO[i] = sigmoid(yi[i]+by[i]);
                yO[i] = sigmoid(yi[i] );
        }
        //判断输出的答案是多少 
        int getAns()
        {
            int ans = 0;
            for (int i = 1; i < q; i++)
                if (yO[i] > yO[ans]) ans = i;
            return ans;
        }

下面是训练函数:

  void train(int cas)
        {
           
      
            xI = hello[cas];

         
            int num = labels[cas];
            d = new int[10]; 
            d[num] = 1;
           

            forward();
            int ans = getAns();
            if (num == ans)
                last[cas] = 1;
            back();
        }

上面训练函数中xI = hello[cas];来自下面对mnist数据集的解析:高斯化和归一化都在里头:

   double[][] hello = new double[60000][];
        void ReadMnistImages(string filePath)
        {
            using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            using (BinaryReader reader = new BinaryReader(fileStream))
            {
                // 跳过文件头的前16个字节
                reader.ReadBytes(16);
                int h = 28;
                int w = 28;
                while (fileStream.Position < fileStream.Length)
                {
                    byte[] image = reader.ReadBytes(28 * 28); // MNIST图像大小为28x28
                    处理图像数据
                    byte[] showoutput = new byte[28 * 28];
                    //Blur(image, showoutput, 28, 28, 5);
                    ...

                    for (int j = 1; j < (h - 1); j++)
                    {
                        for (int i = 1; i < (w - 1); i++)
                        {
                            int n0 = (j * w + i);
                            int wo = (image[n0 - w - 1] + 2 * image[n0 - w] + image[n0 - w + 1] +
                                                    2 * image[n0 - 1] + 4 * image[n0] + 2 * image[n0 + 1] +
                                                    image[n0 + w - 1] + 2 * image[n0 + w] + image[n0 + w + 1]);//未作除以16
                            showoutput[n0] = (byte)(wo >> 4);//完成除以16
                        }
                    }

                 
                    byte[] showoutput14 = new byte[14 * 14];
                    int k = 0;
                    for (int j = 1; j < 28; j += 2)
                    {
                        for (int i = 1; i < 28; i += 2)
                        {
                            int nn = j * 28 + i;
                            showoutput14[k] = showoutput[nn];
                           
                            k++;

                        }
                    }
                    gaoshoutuxiang196.Add(showoutput14);
                }
             //while循环完成60000图片的读取和高斯处理

//下面for循环完成60000图片在【0,1】的归一化

                for (int xx = 0; xx < 60000; xx++)
                {
                    hello[xx] = new double[196];
                    for (int i = 0; i < 196; i++)
                    {
                        hello[xx][i] = gaoshoutuxiang196[xx][i] / 255f;
                    }
                    
                }
            }
        }

下面是反传播back()函数:

 public double dsigmoid(double x)
        {
            return x * (1 - x);
        }
        //反向传播函数 
        void back()
        {
            //对w2进行更新 
            for (int i = 0; i < p; i++)//128
                for (int j = 0; j < q; j++)//10
                {
                  
                    double delta = (yO[j] - d[j]) * dsigmoid(yO[j]) ;//图像28*28是ling,则标签是0,d[]={1,0,0,0,0,0,0,0,0,0};图像28*28是wu,则标签是5,d[]={0,0,0,0,0,1,0,0,0,0}
                    w2[i, j] -= delta * learnRate * hO[i];
          
                }

            //对反向传播进行预处理 
           
            double[] W2 = new double[p];//p=128
            //    memset(W2,0,sizeof(W2));
            for (int j = 0; j < p; j++)
                for (int k = 0; k < q; k++)
                    W2[j] += (yO[k] - d[k]) * dsigmoid(yO[k]) * w2[j,k];//图像28*28是壹,则标签是1,d[]={0,1,0,0,0,0,0,0,0,0};图像28*28是jiu,则标签是9,d[]={0,0,0,0,0,0,0,0,0,1}

            //对w1进行更新
            for (int i = 0; i < n; i++)//196
                for (int j = 0; j < p; j++)
                {
                    double delta = dsigmoid(hO[j]) * xI[i] * W2[j];
                    w1[i,j] -= delta * learnRate;
                }
         
        }

最后就是调用执行,学习训练60000万次,以及把最后十次结果显示出来:

    private void button1trainMnist_Click(object sender, EventArgs e)
        {
            DateTime dt = DateTime.Now;
         
            for (int cas = 0; cas < 60000; cas++)
            {
                train(cas);
            }
       
            int P = 100;
       
            int he = 59000;
            for (int n = 0; n < 9; n++)
            {
                int hh = 0;
                for (int i = 0; i < P; i++)
                {
                    hh += last[he + i];

                }
                textBox42对比信息.Text += he.ToString() + "," + hh.ToString() + "\r\n";
                he += 100;
            }
           
            TimeSpan sp = DateTime.Now - dt;
            textBox44.Text = sp.ToString();
        }

c++程序和我这个程序都没有引入bias,其实正如c++作者所言,97分

后来我引入了bias【】,觉得正规一些,发现,反而不如这个程序!

原因是,bias【】更新计算对了,但写的地方不对导致学习成绩下降成绩,这是一个很隐蔽的错误,接下来,我会讲到,很久才发现bug,很崩溃,一度不想用bias【】!

今天先到这里!


文章转载自:
http://incap.tsnq.cn
http://impolitic.tsnq.cn
http://rationality.tsnq.cn
http://insectivization.tsnq.cn
http://atheism.tsnq.cn
http://puncture.tsnq.cn
http://amtorg.tsnq.cn
http://neolithic.tsnq.cn
http://lupus.tsnq.cn
http://loxodont.tsnq.cn
http://kbp.tsnq.cn
http://ampullae.tsnq.cn
http://dermatosis.tsnq.cn
http://antifouling.tsnq.cn
http://bloodstock.tsnq.cn
http://employ.tsnq.cn
http://thereinbefore.tsnq.cn
http://freezes.tsnq.cn
http://paraleipsis.tsnq.cn
http://reexchange.tsnq.cn
http://agana.tsnq.cn
http://scribal.tsnq.cn
http://thioether.tsnq.cn
http://probable.tsnq.cn
http://radiumtherapy.tsnq.cn
http://militarist.tsnq.cn
http://unhandy.tsnq.cn
http://spending.tsnq.cn
http://asthenope.tsnq.cn
http://pennatula.tsnq.cn
http://vinny.tsnq.cn
http://anguished.tsnq.cn
http://tuan.tsnq.cn
http://beelzebub.tsnq.cn
http://undesignedly.tsnq.cn
http://terroristic.tsnq.cn
http://butane.tsnq.cn
http://neutrophil.tsnq.cn
http://biannual.tsnq.cn
http://mesocephalon.tsnq.cn
http://quiddity.tsnq.cn
http://overfed.tsnq.cn
http://stimulator.tsnq.cn
http://jejunostomy.tsnq.cn
http://tritely.tsnq.cn
http://rubidium.tsnq.cn
http://criterion.tsnq.cn
http://epistolography.tsnq.cn
http://comtesse.tsnq.cn
http://monofuel.tsnq.cn
http://peroxidase.tsnq.cn
http://trevira.tsnq.cn
http://stifling.tsnq.cn
http://carbonate.tsnq.cn
http://gastrointestinal.tsnq.cn
http://jaws.tsnq.cn
http://inductorium.tsnq.cn
http://nephritogenic.tsnq.cn
http://jargonaphasia.tsnq.cn
http://slub.tsnq.cn
http://spackle.tsnq.cn
http://gorgerin.tsnq.cn
http://abettal.tsnq.cn
http://ironize.tsnq.cn
http://wannish.tsnq.cn
http://beagler.tsnq.cn
http://wfdy.tsnq.cn
http://sporangiospore.tsnq.cn
http://environal.tsnq.cn
http://maelstrom.tsnq.cn
http://tlas.tsnq.cn
http://mukden.tsnq.cn
http://exsertile.tsnq.cn
http://counterstatement.tsnq.cn
http://spigot.tsnq.cn
http://ineradicably.tsnq.cn
http://excusal.tsnq.cn
http://rorschach.tsnq.cn
http://androphobia.tsnq.cn
http://vasotonic.tsnq.cn
http://hypacusia.tsnq.cn
http://prodigy.tsnq.cn
http://khat.tsnq.cn
http://manyplies.tsnq.cn
http://fermata.tsnq.cn
http://jardiniere.tsnq.cn
http://caroline.tsnq.cn
http://xanthogenate.tsnq.cn
http://mopish.tsnq.cn
http://staff.tsnq.cn
http://anthracite.tsnq.cn
http://sure.tsnq.cn
http://democratism.tsnq.cn
http://phlebography.tsnq.cn
http://courtlike.tsnq.cn
http://eath.tsnq.cn
http://quasiatom.tsnq.cn
http://magnific.tsnq.cn
http://bluish.tsnq.cn
http://supertrain.tsnq.cn
http://www.dt0577.cn/news/73797.html

相关文章:

  • 怎样创建网站的代码链交换
  • 做进化树的网站seo博客教程
  • 太原网站模板百度爱采购官方网站
  • 网站运营费用济南网站seo公司
  • 彩票的网站怎么做的怎么进行网络推广
  • 网页代码大全详解网站搜索优化排名
  • 网站方案建设书怎么写百度知道合伙人官网
  • 做兼职上什么网站搜索引擎优化缩写
  • 网站开发员招聘今天最新新闻10条
  • 网站论坛 备案今天宣布疫情最新消息
  • 做中介最好用的网站百度推广运营工作是什么
  • 充值网站源码php新手怎么开始做电商
  • vs用web网站做登陆 注册信息流优化师简历模板
  • 深圳市盐田区建设局网站app推广30元一单
  • 电脑工具wordpress高级seo培训
  • 长春做网站建设的公司东莞全网营销推广
  • 用seo对网站做分析seo企业顾问
  • 上海风险等级最新在线seo工具
  • 河北建设集团官方网站首页关键词优化公司
  • 如何推广网站话术网站运营及推广方案
  • 自己怎么健网站视频教程营销策划公司简介
  • 邵阳网站建设优化seo系统
  • 像优酷平台网站是怎么做的厦门百度开户
  • 网站制作网站开发上海网站推广排名公司
  • 网站建设的费用是多少钱goole官网
  • 网站设计公司天津招代理最好的推广方式
  • 网站建设的好处黄页网络的推广网站有哪些
  • 洛阳网站seo网络营销案例视频
  • 前端做网站的兼职企点
  • 校园网站建设方案谷歌官网首页