Giter Club home page Giter Club logo

Comments (1)

HowieMa avatar HowieMa commented on August 19, 2024

Thank you very much for your work. I have a problem: if nn. MSELoss () is used as the loss function, and the Heatmap output from the network is directly compared with the generated Heatmap, the loss value will be abnormally large. How to deal with this problem?
I found that your code is:
criterion = nn.MSELoss(reduction='sum')
loss = criterion(pred, target)
return loss / (pred.shape[0] * 46.0 * 46.0)
Do you use this loss function to avoid excessive loss?

Hi, thank you for asking. The output size is (batch_size, S=3, C=21, 46, 46), because we have 3 stages for keypoints, 21 keypoints, and image size is 46 * 46. As I use 'nn.MSELoss(reduction='sum')', so I need to divide the batch size * 46 * 46 to make it smaller. You can also use 'nn.MSELoss(reduction='mean')' to avoid dividing.

I write the loss function in this way simply because I want the loss value can reflect the stage number S and channel number C. In detail, the first 3 stages are mask or limb representation, and it has size (batch size, S=3, C=1 or 7, 46, 46). And the last 3 stages are keypoints heatmaps, and its size is (batch size, S=3, C=21, 46, 46).

from nsrmhand.

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.