Git Product home page Git Product logo

evonorm's Introduction

Evolving Normalization-Activation Layers

Google AI and DeepMind

  • Implement EvoNorm S0 and B0 with Training Mode support
  • Solve Shape Error with group_std and instance_std functions
  • Solve NaN Error Issue with S0
  • Fix Error with shape in running variance calculation in EvoNorm B0
  • Solve NaN Error Issue with B0

Figure 1. Left: Computation graph of a searched normalization activation layer that is batch-independent, named EvoNorm-S0. Right: ResNet-50 results with EvoNorm-S0 as the batch size over 8 workers varies from 1024 to 32 on ImageNet. EvoNorm-S0 also outperforms both BN and GN-based layers on MobileNetV2 and Mask R-CNN.

Usage:

from evonorm2d import EvoNorm2D
# For B0 version
evoB0 = EvoNorm2D(input, affine = True, version = 'B0', training = True)

# For S0 version 
evoS0 = EvoNorm2D(input)

evonorm's People

Contributors

charlesxjyang avatar digantamisra98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

evonorm's Issues

Improvement on group_std in EvoNorm2D

Hi,

to make easy use of the layer, I noticed that it can help to add a groups argument to the initialization of the layer. This groups argument can then be given to the group_std calculation to adjust for the amount of groups that one wants to define.
Otherwise you are stuck with the default value of 32.

Kind regards

What is a norm_layer?

Hi, thank you for the nice implementation. I've got a question about how you use the EvoNorm S0 in the BasicBlock (your block definition):

        self.evo = EvoNorm2D(planes)
        self.relu = nn.ReLU(inplace=True)
        self.conv2 = conv3x3(planes, planes)
        self.bn2 = norm_layer(planes)

What would be the norm_layer in this case? My understanding of the original paper is that the norm_lyaer(planes) has to actually be EvoNorm2D(planes, non_linear=False). At least that is what I understood from Figure 5's capture and a footnote there (see the original paper).

What is your take on that?

内存泄漏

作者你好,我在使用你的代码训练模型的时候,发现内存一直在涨,请问你是否发现有内存泄漏的问题?

apply to evonorm1d(sequence data)

Hi, i have read your code,but i want to know whether evo_norm could be used for sequence-data, for example, the dims in data just likes batch_size, seq_len, embedding_dims.
In other words, N, C, H, W = x.size(), does C correspond to embedding_dims?

ResNet First Conv Layer

I noticed that the first conv layer of ResNet is followed by BatchNorm Layer, I think it should also be followed by EvoNorm as well.

self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, bias=False) self.bn1 = nn.BatchNorm2d(64) self.relu = nn.ReLU(inplace=True)

l34 raises an error

def __init__(self, input, non_linear = True, version = 'S0', efficien affine = True,

There is a space between efficien and affine. Not sure what should be written instead (erase "efficien" ?)

NaN when width=channel=1, B0

I am using this on my own computer vision dataset. My image size is small enough that when the image size ends up being (batch_size,n_channels,1,1), the EvoNorm begins returning NaN's. I know the reason is because the width=channel=1 because when I make my network smaller with less convolution layers i.e. width,channel>1, the NaN's go away. Is there any reason why this is the case?

self.eps is missing in evonorm2d.py

Maybe this is my misunderstanding. But it looks like evonorm2d.py line 55 which is using self.eps, but there is no self.eps definition at init function.

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.