Giter Club home page Giter Club logo

weavenet's Introduction

WeaveNet

版权所有:北京知天智为气象科技有限公司

介绍

一个使用C#编写的用于神经网络的计算图框架computational graph。带有 cnn,bp,fcn,lstm,convlstm,GRU 等示例。使用方法接进pytorch。

软件架构

架构完全使用c#编写,可以看到内部任何细节的实现,包含 cnn,bp,fcn,lstm,convlstm,GRU 等示例内容,包含示例所用的数据内容。 各项功能都在进行或者完事中,欢迎您参与此项事业,可与我联系:QQ群17375149,QQ20573886,email:[email protected]

使用说明

  1. LOSS支持:MESLOSS,cross-entropy
  2. 激活函数支持:ReLu,Tanh,Sigmod,Softmax
  3. 数据类型支持: float[][] 与 float[][][,],二维与四维
  4. 池化支持:平均池化,最大池化
  5. 其他支持:ConvLayer,Conv2DLayer,MulLayer,ConvTranspose2DLayer

部分BP代码示例

          //声明两个ConvLayer 和一个激活函数SigmodLayer 
          ConvLayer cl1 = new ConvLayer(13, 5, true);
          
            SigmodLayer sl = new SigmodLayer();
            float lr = 0.5f;
            ConvLayer cl2 = new ConvLayer(5, 1, true);
            
            int i = 0,a=0;
            while (a < 5000)
            {
                 
                    dynamic ff = cl1.Forward(x);
                    ff = sl.Forward(ff);
                    ff = cl2.Forward(ff);
                   
                    //计算误差
                    MSELoss mloss = new MSELoss();
                   
                    var loss = mloss.Forward(ff, y);

                    Console.WriteLine("误差:" + loss);

                    dynamic grid = mloss.Backward();

                    //反传播w2
                   
                    dynamic w22 = cl2.backweight(grid);

                    //反传播W1
                    dynamic grid1 = cl2.backward(grid);
                    grid1 = sl.Backward(grid1);
                    dynamic w11 = cl1.backweight(grid1);
                       
                   //更新参数
                    cl2.weights = Matrix.MatrixSub(cl2.weights, Matrix.multiply(w22.grid, lr));
                    cl2.basicData = Matrix.MatrixSub(cl2.basicData, Matrix.multiply(w22.basic, lr));

                    cl1.weights = Matrix.MatrixSub(cl1.weights, Matrix.multiply(w11.grid, lr));
                    cl1.basicData = Matrix.MatrixSub(cl1.basicData, Matrix.multiply(w11.basic, lr));
                    i++;
              
                a++;
            }

BP网络运行图

BP网络运行图

CNN网络95%识别成功率

输入图片说明

lstm网络预测PM2.5空气质量

lstm网络预测PM2.5空气质量

weavenet's People

Contributors

dreamsfly900 avatar zhaohuiyingxue avatar

Stargazers

 avatar well.james avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar li avatar Bingfeng Liu avatar ENVY avatar 问道老王 avatar  avatar vzeng avatar geffzhang avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.