Giter VIP home page Giter VIP logo

Comments (3)

wcyjerry avatar wcyjerry commented on August 16, 2024

So, I dont know is it right,

pc = probs[:, self.idc, ...].type(torch.float32)
dc = dist_maps[:, self.idc, ...].type(torch.float32)

change to

pc = probs[:, 0, ...].type(torch.float32)
dc = dist_maps[:, self.idc, ...].type(torch.float32)

from boundary-loss.

wcyjerry avatar wcyjerry commented on August 16, 2024

Also, I want to know, in the onehot2dis function, dtype is none so the res would be all integer, if it is ok I change it to float cause all my target is only few pixel, and I think this would be more precisely

from boundary-loss.

HKervadec avatar HKervadec commented on August 16, 2024

Hi,

If you are using a sigmoid, then I am assuming that you are in a binary case. In that case the one-hot encoding of the label is redundant, but to keep changes to a minimum, for you case, you could go with:

pc = probs[:, 0, ...].type(torch.float32)
dc = dist_maps[:, 1, ...].type(torch.float32)

as self.idc would always have the value of [1] (it is mostly useful in multi-class).

Also, I want to know, in the onehot2dis function, dtype is none so the res would be all integer, if it is ok I change it to float cause all my target is only few pixel, and I think this would be more precisely

Yes that would work. I think I added the dtype option at the time, so that the code could handle distances maps with varying resolution across axises.

But to be useful, you would need to pass a resolution argument, otherwise you would only fill a float tensor with integers.

Cheers,

Hoel

from boundary-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.