Coder Social home page Coder Social logo

focal-loss's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

focal-loss's Issues

How does it work?

Hi,sciencefans:
thank you for sharing your code , and I want to know is the Focal Loss work well?? How much improve than before?

some questions

when calculate average loss,why not ignore the number of ignored label?(loss = loss/batch_size is not correct?)Thank you!

prototext files

can you provide train_test.prototext and solver.prototext file?

error LNK2001

please, I got this error“error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl caffe::FocalLossLayer::Forward_gpu(class std::vector<class caffe::Blob *,class std::allocator<class caffe::Blob *> > const &,class std::vector<class caffe::Blob *,class std::allocator<class caffe::Blob *> > const &)" (?Forward_gpu@?$FocalLossLayer@N@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@v?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@0@Z) E:\DXD\caffefl\caffe\windows\caffe\focal_loss_layer.obj caffe

Some question about the focal_loss_layer.cpp

Hi
I find the focal_loss_layer.cpp is similar with sigmoid_cross_entropy_loss_layer.cpp.
The only difference is that you define the num = bottom[0]->num() , and the top[0]->mutable_cpu_data()[0] = loss / num ,instead of top[0]->mutable_cpu_data()[0] = loss/normalizer_ .
May I ask what's the meaning of the num,and where is the focal-loss?
Thanks

the normalization is weird

Hi,

to normalize loss, you divide the loss by the total count of anchors, but the paper suggest to divide only the positive anchors.

Why did you do that?

thanks

SIGABRT error

Any idea why would i be getting this error:

*** Aborted at 1504167002 (unix time) try "date -d @1504167002" if you are using GNU date ***
PC: @     0x2b47a0e52cc9 (unknown)
*** SIGABRT (@0x18cf00003615) received by PID 13845 (TID 0x2b479e738280) from PID 13845; stack trace: ***
    @     0x2b47a0e52d40 (unknown)
    @     0x2b47a0e52cc9 (unknown)
    @     0x2b47a0e560d8 (unknown)
    @     0x2b47a0e8ff24 (unknown)
    @     0x2b47a0e9dac6 (unknown)
    @     0x2b47a0e9f340 (unknown)
    @     0x2b47a01afdad (unknown)
    @     0x2b479fc9f63e (unknown)
    @     0x2b479eae4504 caffe::LayerParameter::MergeFrom()
    @     0x2b479eb39fd0 caffe::InsertSplits()
    @     0x2b479ed1c97d caffe::Net<>::Init()
    @     0x2b479ed1ef15 caffe::Net<>::Net()
    @     0x2b479ecca1ba caffe::Solver<>::InitTrainNet()
    @     0x2b479eccb1cc caffe::Solver<>::Init()
    @     0x2b479eccb4fa caffe::Solver<>::Solver()
    @     0x2b479ecf26d3 caffe::Creator_SGDSolver<>()
    @           0x40fcf8 caffe::SolverRegistry<>::CreateSolver()
    @           0x408e34 train()
    @           0x4065ac main
    @     0x2b47a0e3dec5 (unknown)
    @           0x406eb3 (unknown)
    @                0x0 (unknown)

Thanks in advance

FocalLossForwardGPU has unrecognized token

I found unrecognized token in gpu file:

`oriloss[ i ] = - £¨input_data[ i ] * ( target[ i ] - ( input_data[ i ] >= 0 ) ) -

			log(1 + exp(input_data[ i ] - 2 * input_data[ i ] *

			( input_data[ i ] >= 0 )))£©;`

focal_loss_layer.cpp:43] Check failed: bottom[0]->count() == bottom[1]->count() (8 vs. 4) SIGMOID_CROSS_ENTROPY_LOSS layer inputs must have the same count.

hi, @liuyuisanai
when i train the model for 2 classification, I have this error. So, I try to change the output num of fc layer from 2 to 1. It can work. But the acc is very low...just about 60%...I use the same focal loss layer as the README. Please help me. The following is the fc layer and focal loss layer:
layer {
name: "fc1"
type: "InnerProduct"
bottom: "view_blob1"
top: "fc_blob1"
inner_product_param {
num_output: 2
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layer {
name: "loss_focal"
type: "FocalLoss"
bottom: "fc_blob1"
bottom: "label"
top: "loss_focal"
loss_weight: 10
loss_param{
normalize: true
normalization: FULL
}
}
thank you very much.

Seems incorrect use of alpha

According to the paper, the loss should multiply alpha for positive samples and (1-alpha) for negative samples, while the code uses alpha for both positive and negative samples.

When gamma set below 1, loss will go to nan

I set alpha to 0.5 and gamma to 0.5, the loss will go to NAN. After changing gamma to 1, loss became normal. I didn't see any restriction of gamma in the paper. Is there difference between your code and the paper?

please help!

when i run this code,i got this error: Check failed: bottom[0]->count() == bottom[1]->count() (20 vs. 10) SIGMOID_CROSS_ENTROPY_LOSS layer inputs must have the same count.
how do i solve it?

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.