Giter Site home page Giter Site logo

Typo in dropout line? about nsfw_model HOT 5 CLOSED

gantman avatar gantman commented on May 17, 2024
Typo in dropout line?

from nsfw_model.

Comments (5)

GantMan avatar GantMan commented on May 17, 2024

Good catch, would you like to submit a PR?

from nsfw_model.

jessetrana avatar jessetrana commented on May 17, 2024

What was the original intent? I'm assuming the "-" is effectively evaluating rather than assigning and causing the line of dropout to basically disappear. "Reenabling" this line seems like it might cause more regularization than you intended.
If regularization is intended in both locations, it seems like a SpatialDropout2D might be a better fit while perhaps reducing the rate in both places. My limited experience has led me to something like this for use in my own finetuning:
x = model_mn.output #basically MobileNetV2 without the top
x = SpatialDropout2D(0.1)(x)
x = GlobalAveragePooling2D()(x)
x = Dense(128, name='fc_final', activation='relu')(x)
x = Dropout(0.25, name='dropout')(x)
x = Dense(NUM_CLASSES, name='classifier', activation='softmax')(x)

I see slightly better accuracy with this approach than my prior approach of no spatial dropout and setting just the one dropout to 0.45. But of course, everybody's use case is a little different and in particular with your dataset being as large as it is, I'm not sure what the best route is. (My current dataset is about 100K with four classes but some oversampling due to class imbalance, as a reference point.) What variant do you think will work best for your situation?
(Also - I'm quite hesitant to submit a PR without running it myself, and do not currently have a great system to test this large of a dataset on.)

from nsfw_model.

GantMan avatar GantMan commented on May 17, 2024

You're right. I tried training with the dropout returning, and it destroyed training performance.

from nsfw_model.

jessetrana avatar jessetrana commented on May 17, 2024

#29 Here's a PR for nixing the bad dropout line.

from nsfw_model.

jessetrana avatar jessetrana commented on May 17, 2024

This got merged a long time ago, closing!

from nsfw_model.

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.