Giter Club home page Giter Club logo

Comments (3)

eriklindernoren avatar eriklindernoren commented on July 27, 2024 3

Optimizing the network to minimize the crossentropy loss means minimizing the distance between ground truth labels (1 for index of class and 0 for the others) and the prediction of the network. In the case where a sigmoid activation function is applied the output will be between 0 and 1, but the network is not constrained so that the outputs sum to one, as is the case when a softmax activation function is used. The softmax activation function is normally applied together with the crossentropy loss as this essentially means that the network will be trained to maximize the output where the ground truth label is 1 and minimize all others. The fact that the difference is only one in this case is not really an issue. However, in this case the authors argued that it makes more sense to use a sigmoid activation function (instead of softmax) since the class labels for an object does not necessarily need to be mutually exclusive, e.g. a labrador should be able to be labeled as both a dog and a labrador. In this case it makes more sense to use a binary crossentropy loss, since this loss does not assume that the outputs should sum to one.

from pytorch-yolov3.

alexandru-dinu avatar alexandru-dinu commented on July 27, 2024

Right now, I just came across the commit where you have changed the CrossEntropyLoss, sorry for not looking before opening the issue.

Nevertheless, was this the reason for the change?

from pytorch-yolov3.

riktimmondal avatar riktimmondal commented on July 27, 2024

Thanks for the awesome repo. For my dataset all the objects are exclusive so I think using softmax will be more efficient. Can you suggest where should i make changes to use softmax classifier instead of sigmoid for multi-class classifier.

from pytorch-yolov3.

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.