Coder Social home page Coder Social logo

Model performance about nfnets_pytorch HOT 9 CLOSED

benjs avatar benjs commented on July 18, 2024
Model performance

from nfnets_pytorch.

Comments (9)

benjs avatar benjs commented on July 18, 2024

The accuracy is the result of taking the pretrained weights from the original repo and running eval.py.

When training from scratch using this code, there are multiple things missing for best results.
train.py should reach the baseline accuracy as described in the paper, however, this is not tested as I don't have the computing resources or money to train such large models.

from nfnets_pytorch.

guozhiyao avatar guozhiyao commented on July 18, 2024

Then why the results are inconsistent with Top-1 accuracy Brock et al.?

from nfnets_pytorch.

benjs avatar benjs commented on July 18, 2024

They preprocess the input images differently. I tried to implement their method but it was a bit worse than simple resizing.

With such small differences, there can be many things that cause them (resizing algorithm, ...)

from nfnets_pytorch.

guozhiyao avatar guozhiyao commented on July 18, 2024

ok. Thanks a lot.

from nfnets_pytorch.

guozhiyao avatar guozhiyao commented on July 18, 2024

I calculated the #Params and found that they were inconsistent with those reported in the paper. The calculation method

size = 0
for p in net.parameters():
    size += p.numel()
print(size*4/1024/1024)

from nfnets_pytorch.

benjs avatar benjs commented on July 18, 2024

What was the result of your calculation?

from nfnets_pytorch.

guozhiyao avatar guozhiyao commented on July 18, 2024

I test all NFNets and set the num_classes=1000, stochdepth_rate=0.25, alpha=0.2, se_ratio=0.5, activation='gelu', and the results are: 272.7MB, 506.0MB, 739.2MB, 972.5MB, 1205.7MB, 1439.0MB, 1672.2MB, 1905.5MB.

from nfnets_pytorch.

benjs avatar benjs commented on July 18, 2024

I guess the correct parameter count is in the #Params column in table 3 of the paper.

Your code counts the number of bytes, assuming that one parameter is of type float32 and thus has 4 bytes.

The paper however simply provides the number of parameter, not the number of bytes.

When you change your print statement to
print(size/1000/1000), you'll see that the count is correct.

from nfnets_pytorch.

guozhiyao avatar guozhiyao commented on July 18, 2024

Yes, you are right. Thank you for your reply.

from nfnets_pytorch.

Related Issues (7)

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.