Coder Social home page Coder Social logo

Comments (4)

varunjampani avatar varunjampani commented on June 15, 2024

Hi,

Your interpretation of loss is correct. We use Euclidean loss on position features and 'Loss without Softmax' on segment labels. Lines 293 and 312 in https://github.com/NVlabs/ssn_superpixels/blob/master/create_net.py.

'LossWithoutSoftmax' layer is a custom layer I implemented which is a modified version of 'SoftmaxWithLoss' layer. SoftmaxWithLoss layer (http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SoftmaxWithLossLayer.html) does 'Softmax' followed by 'Multinomial logistic loss'. In 'LossWithoutSoftmax', we directly do multinomial logistic loss without Softmax. Please check whether there is softmax or not in the cross entropy loss you are using.

A student I am advising is also planning to do a pytorch implementation. I think, it would be good to co-ordinate these efforts in porting to pytorch. Would you be interested in co-ordinating? Can you email me if you are interested?

Thanks,
Varun

from ssn_superpixels.

 avatar commented on June 15, 2024

Thanks Varun,

I realized the implementation of l2 norm in caffe is actually different from pytorch, so just to confirm the loss function. Given a input size as b * c * h * w, the loss will be:

L = 1e-5 (2N) i N ||x1i - x2i|| 2 + ∑i N qi log (pi)

where N = b * h * w,
x1 is pos_pix_feat , x2 is pos_recon_feat,
q is ori_label and p is rec_label . Is it correct?

It would be very nice to have a further decision. A email has been sent to [email protected].

from ssn_superpixels.

varunjampani avatar varunjampani commented on June 15, 2024

The equations seem correct. I do not clearly remember if caffe uses 1/2N or 1/N for Eucledian loss.

from ssn_superpixels.

 avatar commented on June 15, 2024

I checked the caffe document, and I believe they use 1/2N for that.
http://caffe.berkeleyvision.org/tutorial/layers/euclideanloss.html

Thanks a lot for your kind reply!

from ssn_superpixels.

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.