Coder Social home page Coder Social logo

Comments (4)

JoseAF avatar JoseAF commented on May 18, 2024

Sorry for coming back to this again but I'm still having this issue.

So far I've tried adding "//yggdrasil_decision_forests/learner/gradient_boosted_trees/loss:loss_imp_binomial" to the cc_library_ydf at \yggdrasil-decision-forests\yggdrasil_decision_forests\learner\gradient_boosted_trees\BUILD and building the lib again but this doesn't fix the issue. Perhaps I should add it somewhere else?

I have also tried adding:

CreateLoss(proto::Loss::BINOMIAL_LOG_LIKELIHOOD, proto::Task::CLASSIFICATION, myFeatureCol, config)

to my code (although probably this is not needed, as I'm not using early stopping). This doesn't help either...

from yggdrasil-decision-forests.

achoum avatar achoum commented on May 18, 2024

Hi JoseAF,

Sorry to hear about this.

As you noted, the part of the code related to losses has changed. Losses are now using a registration mechanism similarly as for the learner, models and dataset formats. In most existing code, I would expect no changes in the user code. But I could imagine corner cases where you would have to register those losses manually (that is to link :loss_imp_binomial, or one of its dependents).

Following is the path used to inject :loss_imp_binomial in most user code. It could be useful to identify if you need to inject the loss manually:

The loss implementation "BINOMIAL_LOG_LIKELIHOOD" is defined in the file yggdrasil_decision_forests/learner/gradient_boosted_trees/loss/loss_imp_binary_focal.h and compiled in the rule :loss_imp_binomial of the file https://github.com/google/yggdrasil-decision-forests/blob/main/yggdrasil_decision_forests/learner/gradient_boosted_trees/loss/BUILD. Your error suggest that none of the losses are registered. For our tools, those losses are registered in the build rule :all_implementations of in file https://github.com/google/yggdrasil-decision-forests/blob/main/yggdrasil_decision_forests/learner/gradient_boosted_trees/loss/BUILD. ;all_implementations is used in yggdrasil_decision_forests/learner/gradient_boosted_trees, which is itself used in the build rule :all_learners or https://github.com/google/yggdrasil-decision-forests/blob/main/yggdrasil_decision_forests/learner/BUILD.

If this does not solve this issue, please try the bazel query tool. Notably, identify the path from your binary to :loss_imp_binomial. If such path does not exist, you have to register :loss_imp_binomial (or one of its decedents) manually.

from yggdrasil-decision-forests.

JoseAF avatar JoseAF commented on May 18, 2024

Thanks for the reply Mathieu.

In my setting (as it comes from YDF checkout), BinomialLogLikelihoodLoss is defined in loss_imp_binomial.h and registered there as BINOMIAL_LOG_LIKELIHOOD. In gradient_boosted_trees/loss:BUILD we have the cc_library_ydf:loss_imp_binomial and also the cc_library_ydf:all_implementations which includes it. This all_implementations in turn is a dependency of cc_library_ydf:gradient_boosted_trees (at gradient_boosted_trees/BUILD file). When I get to the learner/BUILD file, I see that cc_library_ydf:all_learners depends on all_learners_except_hparam_optimizer, which in turn depends on gradient_boosted_trees. So there seems to be a defined path from learner to BINOMIAL_LOG_LIKELIHOOD - that's what made me think perhaps I'm missing something in the code that now needs to be added (e.g. CreateLoss...).

I'll have a look at the bazel query tool...

from yggdrasil-decision-forests.

JoseAF avatar JoseAF commented on May 18, 2024

Hi guys

I haven't got this working yet. It seems all the dependencies are correct in the BUILD files as far as I can see. I have built a lib with tensorflow in case I was missing something from there but the error persists. I have also added a CreateLoss call and a set_loss call to try to trigger registering of the BINOMIAL_LOG_LIKELIHOOD loss but no luck. I'll keep trying, but any ideas are welcomed here...

Just for your information, in case it helps, the code I have works perfectly well with 0.2.3 and I haven't made changes to the BUILD files that I get from github.

Thanks

from yggdrasil-decision-forests.

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.