-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DiscreteFactorGraph::optimize to return MPE #1050
Conversation
@keevindoherty FYI. If you relied optimize, there might be discrepancies with the actual MPE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments. I can address them if need be to save time.
@varunagrawal sign off? Do you know what could be up with failing CI? |
This is the same issue that Fan had, it's a deprecation of the setup.py install command for python. |
Thanks. Done. Note it's not approved yet so I can't merge... Is there anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I was literally in the middle of the review :) |
Hmmm, after the cherry-pick, 10 runs are failing rather than 2… any ideas? |
@varunagrawal could you please explain more about your fix? Linux complains:
What was the issue you tried to solve? What article described the fix? You said “ deprecation of the setup.py install command for python”. Where was it=t deprecated? finally, use of pip directly seems wrong. If anything, |
Also, why does not affect the entirety of GTSAM? If so, seems worthy of its own PR in GTSAM, with explanation of issue in PR description. |
The Python Packaging Authority has decided to deprecate direct builds via calling setup.py (aka This effect first showed up on MacOS with the following error:
I myself use a We are now seeing the deprecation effects in Ubuntu as well, so yeah this is going to need a bit of refactoring of the CI. This is something that really annoys me about Github Actions is that they run environment upgrades pretty arbitrarily. I imagine this will effect the entirety of GTSAM going forward. About using |
Awesome description above. Perhaps you can copy/paste some of the comment above in the (rather terse) comment of #1054 ? About GA: can't we specify whatever exact version we want ? About pip: just heard that sometimes pip on path is a different version so #PYTHON -m pip ensures you have the pip version paired with the python version. |
We can always do |
# Conflicts: # .github/scripts/python.sh
Major Changes
This PR fixes #1048. In particular:
DiscreteFactorGraph::optimize
now really computes the MPE (maximum probable explanation)DiscreteFactorGraph::maxProduct
OrderingType
orOrdering
DiscreteBayesNet::optimize
andDiscreteConditional::solve
, as they do nothing really usefulgtsam_unstable/discrete
: redundant with optimize. Not deprecated, just gone!Max-product details:
I introduce two new classes (in one header/cpp):
DiscreteLookupTable
: inherits fromDiscreteConditional
to play well with generic elimination, but is supposed to be a lookup table of the maximum values obtained during max-productDiscreteLookupDAG
: a DAG of lookup tables. Made this separate from BayesNet as to not confuse.maxProduct
is implemented with a customEliminate
function inDiscreteFactorGraph.cpp