GithubHelp home page GithubHelp logo

Comments (6)

wy1iu avatar wy1iu commented on May 23, 2024

What is your final loss value for m=4? Without knowing your settings, my best guess is that the m=4 loss have not been properly optimized. If your lambda is close to 0 (when the optimization is over) and the m=4 loss is reasonably low, it is highly unlikely the performance will go down.

from largemargin_softmax_loss.

dldl3D avatar dldl3D commented on May 23, 2024

My settings is as follows:
################## train ##################
layer {
name: "ip2"
type: "LargeMarginInnerProduct"
bottom: "bn_ip"
bottom: "label"
top: "ip2"
top: "lambda"
param {
name: "ip2"
lr_mult: 1
}
largemargin_inner_product_param {
num_output: 4
#type: SINGLE
#base: 0
type: QUADRUPLE
base: 900
gamma: 0.0000055
power: 40
iteration: 0
lambda_min: 0
weight_filler {
type: "msra"
}
}
include {
phase: TRAIN
}
}
################# test ##################
layer {
name: "ip2"
type: "LargeMarginInnerProduct"
bottom: "bn_ip"
bottom: "label"
top: "ip2"
top: "lambda"
param {
name: "ip2"
lr_mult: 0
}
largemargin_inner_product_param {
num_output: 4
type:SINGLE
base: 0
gamma: 0.0000055
power: 40
iteration: 0
lambda_min: 0
weight_filler {
type: "msra"
}
}
include {
phase: TEST
}
}
layer {
name: "accuracy"
type: "Accuracy"
bottom: "ip2"
bottom: "label"
top: "accuracy"
include {
phase: TEST
}
}
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "ip2"
bottom: "label"
top: "loss"
}
The lambda is 0.9726 when the optimization.

from largemargin_softmax_loss.

wy1iu avatar wy1iu commented on May 23, 2024

It seems your dataset is quite easy, since you can achieve quite good results with m=1. The final lambda is actually too high for such easy dataset. You should consider increase the parameter power or change the gamma a little bit, or even increase the iteration number in order to make lambda decrease more rapidly. I think the final lambda should be nearly 0, say below 10^-5, to achieve the best results.

from largemargin_softmax_loss.

dldl3D avatar dldl3D commented on May 23, 2024

When the lambda decrease rapidly, the network diverges. How can I fix it?

from largemargin_softmax_loss.

wy1iu avatar wy1iu commented on May 23, 2024

You should change gamma to a a smaller value, or set a small lambda_min.

from largemargin_softmax_loss.

wy1iu avatar wy1iu commented on May 23, 2024

BTW, I just fix a bug about lambda_min. You should use the new version

from largemargin_softmax_loss.

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.