Giter Site home page Giter Site logo

cnn_np's Introduction

cnn_np

本仓库主要使用numpy来实现深度学习中常用的网络结构,复习深度学习相关知识。

使用构造的网络模块搭建LeNet-5(结构参考Caffe实现)训练手写数字识别。


卷积

卷积模块实现时,使用标准模块测试输入输出。

卷积前向传播较为简单,只需要将权值转换为列向量,图像转换为列向量,然后按照矩阵乘法同时加上偏置在转换为图像即可。

卷积反向传播较难,首先通过误差计算权值和偏置的梯度,然后计算该误差下一传播过程中的误差,该计算中注意误差需要通过pad然后转换为列向量,和权重上下翻转后相乘即可。

pytorch卷积实现conv.py

在 Caffe 中如何计算卷积? 贾扬清讲解caffe中如何计算卷积。

Convolutional Neural Networks backpropagation: from intuition to derivation


池化层

本仓库实现了MaxPool2d。

Convnet: Implementing Maxpool Layer with Numpy


全连接层

全连接层

linear.py


Softmax层

Softmax层当前神经元的输出对当前的神经元的导数之和$-a_ia_j$以及$a_i(1-a_i)$。

softmax函数与交叉熵的反向梯度传导 本文介绍了softmax层的反向传播。


激活函数层

activation.py pytorch中激活函数设计参考。


损失函数层

CrossEntropy层使用了one-hot编码的target。

pytorch loss function 总结 其中介绍了pytorch中各个损失函数的关系,本仓库实现CrossEntropy包含LogSoftmax。

loss.py pytorch中相应的loss设计参考。

One Hot Encoding using numpy

numpy之one-hot


实现日志

  • Conv2d
  • Pool2d
  • Linear
  • Softmax
  • CrossEntropy
  • ReLU
  • LReLU

参考链接

cnn_np's People

Contributors

guanfuchen avatar

Watchers

James Cloos 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.