Git Product home page Git Product logo

Comments (9)

grayicon avatar grayicon commented on May 18, 2024 1

@grayicon oh, I think now I understand. I removed this line in this commit. Does it look good now?

Yes,It can work now, Thanks for your effort.

from rtdl.

Yura52 avatar Yura52 commented on May 18, 2024

Thank you for the report. Currently, the main branch contains significant amount of unfinished work not released to PyPI, so bugs are expected, and use it at your own risk.

P.S. The formatted version of the above bug report:

instead of this:

is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges)))

it should be this:

is_last_bin = bin_indices + 1 == torch.as_tensor(list(map(len, bin_edges))).unsqueeze(-1))

from rtdl.

Yura52 avatar Yura52 commented on May 18, 2024

@grayicon is it actually a bug?

  • bin_indices + 1 has the shape (n_objects, n_features)
  • as_tensor(list(map(len, bin_edges))) has the shape (n_features,)
  • According to broadcasting rules, the result is_last_bin has the shape (n_objects, n_features)

from rtdl.

Yura52 avatar Yura52 commented on May 18, 2024

Feel free to reopen the issue if needed.

from rtdl.

grayicon avatar grayicon commented on May 18, 2024

@grayicon is it actually a bug?

  • bin_indices + 1 has the shape (n_objects, n_features)
  • as_tensor(list(map(len, bin_edges))) has the shape (n_features,)
  • According to broadcasting rules, the result is_last_bin has the shape (n_objects, n_features)

The above desc is right in theory, but in fact i found the real bug lie in the line #590 of rtdl.data.py "bin_edges = torch.as_tensor(bin_ratios)", which cause the state "as_tensor(list(map(len, bin_edges)))" has the shape (n_objects,)

from rtdl.

Yura52 avatar Yura52 commented on May 18, 2024

So it seems to be the issue reported here, right?

#47

from rtdl.

Yura52 avatar Yura52 commented on May 18, 2024

So it should be now resolved by 7929497

Please, let me know if the issue still there

from rtdl.

grayicon avatar grayicon commented on May 18, 2024

So it should be now resolved by 7929497

Please, let me know if the issue still there

The bin_egdes is a list of torch tensor, So it doesn't support the opera of 'torch.as_tensor'. Consequently, I just comment this line "bin_edges = torch.as_tensor(bin_ratios)", and it will works when call of "map(len, bin_edges) below".

from rtdl.

Yura52 avatar Yura52 commented on May 18, 2024

@grayicon oh, I think now I understand. I removed this line in this commit. Does it look good now?

from rtdl.

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.