Code Monkey home page Code Monkey logo

momentumnet's People

Contributors

michaelsdr avatar pierreablin 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  avatar  avatar  avatar

momentumnet's Issues

Figure 9 Experiments code

Is there any code for the experiment on figure 9 of the paper?
I want to compare three models in Figure 9.

Error in "drop_in_replacement_tutorial.py" ?

In this example setting gamma=0.0 lead to mnet1 and net having two different outputs.

However, everything is fine with resnet18.

(it seems that it apply the residual connection of ResBlock after TransformMemory)

图一含义

(1)不明白图一和论文的关系。(2)图一左右两边想表达什么意思。右边能表达更复杂的动力学行为?

Bug in pytorch 1.10

The following code leads to an error using torch version 1.10 but not 1.9

import torch
from torch import nn
from momentumnet import MomentumNet

init_function = nn.Tanh()
functions = [nn.Linear(3, 3), ]

net = MomentumNet(functions, init_function=init_function, init_speed=True, gamma=0.9,
                                  use_backprop=False)

x = torch.randn(1, 3)

output = net(x).sum()
output.backward()

Changing init_function to something with parameters like

import torch
from torch import nn
from momentumnet import MomentumNet

init_function = nn.Linear(3, 3)
functions = [nn.Linear(3, 3), ]

net = MomentumNet(functions, init_function=init_function, init_speed=True, gamma=0.9,
                                  use_backprop=False)

x = torch.randn(1, 3)

output = net(x).sum()
output.backward()

works fine.

No idea what causes this.

Add method for computing inverse

Hi thanks so much for your work!

Is it possible to add a method for computing the inverse of a layer's activations? Both the iResNet and iRevNet repos have this method. Adding this would really help me experiment with your model more.

Thanks!

Query about Momentum DenseNets

Dear Michael,

Thank you for making your work publicly available. I was wondering your opinion on including momentum in DenseNets. More specifically, do you think that adding momentum in each layers that are connected to every layer in a neural model would yield similar gains in memory?

Missing baseline?

Thanks for your interesting work!

The Reformer uses RevNet in a clever way. They double the dimension of x such that for x1,x2=split(x) both x1 and x2 have the same dimension as the original x. This gives their invertible architecture the "same parameters" as the initial architecture. Let's call this ReformerRevNet.

Question 0. In Table 2, RevNet differs to MomentumNet only in the row "same parameters". I don't see why ReformerRevNet and MomNet would be different in Table 2?

Question 1. Is there any reason this ReformerRevNet baseline was not included?

Apologies for any misunderstanding.

Large memory consumption

I tested the memory consumption of resnet 101 and the corresponding momentum version using the scripts below. However, difference in memory consumption between these 2 models is only a few hundreds MBs.

Pytorch version: 1.9
CUDA toolkit: 11.1
GPU: GTX 1080 Ti
Python 3.7
Ubuntu 18.04

from momentumnet import transform_to_momentumnet
from torchvision.models import resnet101

resnet = resnet101(pretrained=True).to(0)
mresnet101 = transform_to_momentumnet(resnet, gamma=0.99998, use_backprop=False)
#mresnet101 = resnet101(pretrained=True).to(0)
optim = torch.optim.Adam(mresnet101.parameters(), lr=1e-4)

for i in range(100):
    x = torch.randn(70, 3, 224, 224).cuda()
    y = mresnet101(x)
    y = (y**2).mean()
    optim.zero_grad()
    y.backward()
    optim.step()

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.