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

Python script for hybrid inference on City10000 dataset #2019

Merged
merged 21 commits into from
Feb 9, 2025

Conversation

varunagrawal
Copy link
Collaborator

@varunagrawal varunagrawal commented Feb 9, 2025

Wrapped a bunch of methods and recreated the script Hybrid_City10000.cpp as HybridCity10000.py.

I get a similar final error:
Final error: 0.6931471805599453
and a similar total time:
Total time: 21.018189191818237 seconds

Please see the results of this new script below.

hybrid_city10000_py

Update: I added a python script for plotting the results. It takes an arbitrary number of estimate files (.txt) but needs a corresponding number of labels and colors associated.

@varunagrawal varunagrawal requested a review from dellaert February 9, 2025 04:32
@varunagrawal varunagrawal self-assigned this Feb 9, 2025
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.

Cool. I’d undo the std::move changes though. Just adding. Constructor should low you to wrap.

@@ -127,7 +127,7 @@ class Experiment {
auto bayesNet = linearized->eliminateSequential();
HybridValues delta = bayesNet->optimize();
initial_ = initial_.retract(delta.continuous());
smoother_.reInitialize(std::move(*bayesNet));
smoother_.reInitialize(*bayesNet);
Copy link
Member

Choose a reason for hiding this comment

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

Why? Seems appropriate here

@@ -49,8 +49,8 @@ class GTSAM_EXPORT HybridSmoother {
/**
* Re-initialize the smoother from a new hybrid Bayes Net.
*/
void reInitialize(HybridBayesNet&& hybridBayesNet) {
hybridBayesNet_ = std::move(hybridBayesNet);
void reInitialize(HybridBayesNet& hybridBayesNet) {
Copy link
Member

Choose a reason for hiding this comment

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

Just add another non && constructor rather than deleting this one?

@varunagrawal varunagrawal merged commit 82fcedf into develop Feb 9, 2025
35 checks passed
@varunagrawal varunagrawal deleted the city10000-py branch February 9, 2025 18:42
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