Code Monkey home page Code Monkey logo

Comments (9)

wy1iu avatar wy1iu commented on May 21, 2024

see https://github.com/wy1iu/LargeMargin_Softmax_Loss#notes-for-training

from sphereface.

double-vane avatar double-vane commented on May 21, 2024

For large and difficult datasets, you should first try to set lambda_min as 5 or 10
Is this one?
But, when I use sphereface-20, I can get a small lambda_min and the results is good.

from sphereface.

wy1iu avatar wy1iu commented on May 21, 2024

It really depends on the dataset and the network architecture. There is no universally good hyper-parameter in all cases. You should change it depending on your task, dataset and the network.

from sphereface.

double-vane avatar double-vane commented on May 21, 2024

Ok, How to determine lambda_min?
train softmax_loss ? train accuracy? or test results?

from sphereface.

wy1iu avatar wy1iu commented on May 21, 2024

Maybe trying a large value first, and gradually decreasing it could be a good strategy.

Besides the lambda_min. the other hyperparameters also affect the convergence.

from sphereface.

double-vane avatar double-vane commented on May 21, 2024

Okay, I down it from 1000, and my boss wants me to drop it to 5.
I'll try it for more numbers!
Thanks again.
Best!

from sphereface.

fromwhzz avatar fromwhzz commented on May 21, 2024

87.3365 is a magic number. if the data is nan, the softmaxloss will be 87.3365. You can print the debug info to see the wrong. And I think you can print the x_norm and weight norm in the margin_inner product , maybe the x_norm is 0 which will make the data to be nan.

from sphereface.

chiukeung avatar chiukeung commented on May 21, 2024

@fromwhzz I suffered the same problem and according to your suggestion, I found L1 norm = (nan, nan); L2 norm = (nan, nan), loss is always 87.3365. What should I do to solve it? Thanks a lot.

from sphereface.

chandraOloid avatar chandraOloid commented on May 21, 2024

@wy1iu
For a custom dataset, I have 850 ids for train and 877 ids for test with 909 unique ids.

what number should I use for the margin_inner_product in softmax loss ? Also, I have the same problem with softmaxloss=87.335 and final of net.forward with a known image is nan.

Thanks
Chandra

from sphereface.

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.