Skip to content
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

Implement errorTree in DiscreteFactor #1858

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

varunagrawal
Copy link
Collaborator

Common base class method to reduce duplication.

@varunagrawal varunagrawal self-assigned this Oct 1, 2024
Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm. I'm worried about complexity here, especially if we have pruned branches. I think you replaced a sometimes errorTree with an always expensive version.

@varunagrawal
Copy link
Collaborator Author

Hmmmm. I'm worried about complexity here, especially if we have pruned branches. I think you replaced a sometimes errorTree with an always expensive version.

Interesting. I copy-pasted the code from DecisionTreeFactor to DiscreteFactor since TableFactor was anyway calling the DecisionTreeFactor version.
I didn't see this potential issue because except for discreteKeys there is no class specific method being used here. And discreteKeys should be the same for both DiscreteFactor and DecisionTreeFactor.

Maybe the original implementation was already expensive to begin with?

@dellaert
Copy link
Member

dellaert commented Oct 1, 2024

Actually, you are right! We should just call the DecisionTree constructor in the DTF. That is a potential speedup! So, I like your base class implementation for generic, but it should speed up for derived class. Probably also in TableFactor: is toDecisionTreeFactor efficient?

@varunagrawal
Copy link
Collaborator Author

varunagrawal commented Oct 8, 2024

Probably also in TableFactor: is toDecisionTreeFactor efficient?

It should be. It's from @ywkim0606's original PR which you had worked on with him.

@varunagrawal varunagrawal merged commit 77422d4 into develop Oct 16, 2024
33 checks passed
@varunagrawal varunagrawal deleted the discrete-errorTree branch October 16, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants