Giter VIP home page Giter VIP logo

Comments (4)

huanzhang12 avatar huanzhang12 commented on July 2, 2024

@zoharli Thanks for reporting and I will try to reproduce this on my side and keep your posted.

from alpha-beta-crown.

zoharli avatar zoharli commented on July 2, 2024

@huanzhang12 Thank you! Below you can find my model definition and checkpoint file, you can try it directly, hope this can help.
BTW, when testing with CROWN, I find that sometimes clean acc. gets even lower than CROWN acc, is that normal? Thank you!

def cifar_model_deep(num_classes=10,bn=True,channels=None):
    # cifar deep
    if channels==None:
        channels=[32,64,64,128,128]
    assert(len(channels)==5)
    module_list=[
        nn.Conv2d(3, channels[0], 3, stride=1, padding=1),
        nn.ReLU(),
        nn.Conv2d(channels[0], channels[1], 4, stride=2, padding=1),
        nn.ReLU(),
        nn.Conv2d(channels[1], channels[2], 3, stride=1, padding=1),
        nn.ReLU(),
        nn.Conv2d(channels[2], channels[3], 4, stride=2, padding=1),
        nn.ReLU(),
        nn.Conv2d(channels[3], channels[4], 4, stride=2, padding=1),
        nn.ReLU(),
        # nn.Conv2d(128, 256, 4, stride=2, padding=1),
        # nn.ReLU(),
        Flatten(),
        nn.Linear(channels[4]*4*4, 100),
        nn.ReLU(),
        nn.Linear(100, num_classes)
    ]

    new_module_list=[]
    for m in module_list:
        new_module_list.append(m)
        if bn and isinstance(m,nn.Conv2d):
            new_module_list.append(nn.BatchNorm2d(m.out_channels))

    model=nn.Sequential(*new_module_list)

    print(model)

    return model

cifar_model_deep_cibp.zip

from alpha-beta-crown.

huanzhang12 avatar huanzhang12 commented on July 2, 2024

@zoharli We've found the issue for this model. The problem is within the model loader, which did not set the model into eval() mode, so the batchnorm mean and variance were unexpectedly changed. This is easy to fix in utils.py:

https://github.com/huanzhang12/alpha-beta-CROWN/blob/590412434734bf80863cf37da8421f422e39ef37/complete_verifier/utils.py#L178-L180

Just add model_ori.eval() after the above lines to put the model in evaluation mode. We will fix this in our repository, but before we update our repository you can simply add model_ori.eval() and it should solve this problem.

Clean acc. should not be lower than CROWN acc, if that still happens to you after adding model_ori.eval() please let me know, thanks!

from alpha-beta-crown.

zoharli avatar zoharli commented on July 2, 2024

Oh, I get it. Thank you, Truly appreciate your timely help!

from alpha-beta-crown.

Related Issues (20)

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.