Giter Club home page Giter Club logo

non_local_net_tensorflow's Introduction

《Non-local Neural Network》复现

  • Non-local Neural Network

  • 作者公开的源代码-caffe

  • 传统的卷积操作一次只是处理的一个局部邻域(local neighborhood),没有考虑到其他位置的像素对其输出的影响。这篇文章呈现的non-local操作能够捕获远距离的像素之间的依赖关系(long-range dependencies

  • non-local公式如下: $$ y_i = \frac{1}{C(x)}\sum_jf(x_i,x_j)g(x_j) $$ 以图像为例,$i, j$为像素位置,$f(·)$表示$i$和$j$之间的关联系数,也可以说是权重,$g(·)$表示像素j的信息,$C(x)$为归一化系数,整个公式表示遍历所有的点$j$,以$f$为权重,将信息$g$进行加权求和

  • 输入和输出尺寸相同

  • non-local对f和g的形式不敏感

  • Non-local block结构如下:

    non-loca.png

  • 这个结构设置通道的数量为输入x通道数的一半,这样可以减少计算量,然后通过Wz的来让输出Z跟输出X通道数保持一致,这点参考了ResNetbottleneck设计

  • 这个结构实现起来不复杂,文章这个block添加到ResNet50中,分别添加1(to res4)、5(3 to res4 and 2 to res3)、10个(to every residual block in res3 and res4non-local block

  • 论文做的是视频分类,该代码做的实现的是在MNIST数据集上的分类,添加10个non-local blockResNet50

  • 由于采用ResNet50,网络的输入尺寸为224x224,所以为了匹配尺寸,强行将28x28pad为224x224,纯粹是为了尺寸的匹配

  • 计算图:

    graph

  • MNIST上训练结果:

    screenshot

accuracy

loss

non_local_net_tensorflow's People

Contributors

huyz1117 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

non_local_net_tensorflow's Issues

非局部模块会让结果更好吗?

您好,我也在尝试着使用非局部模块。但是,我发现用它做分类问题(试过mnist和cifar10),发现用非局部还不如不用非局部。请问您是否有遇到过同样的现象?后来是怎么解决的呢?
多谢!

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.