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

Major refactor, API changes, new tests #8

Merged
merged 36 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dfdd6d3
Clean up tests.
keevindoherty Aug 2, 2024
b0dbd03
Tidy up Petersen graph sparsification.
keevindoherty Aug 2, 2024
1872b6d
WIP more tidying.
keevindoherty Aug 2, 2024
1c098f6
Reorganizing MAC and Fiedler utilities.
keevindoherty Aug 2, 2024
debcfc8
Cache setup.
keevindoherty Aug 2, 2024
9e8fc49
Full project reorg.
keevindoherty Aug 2, 2024
764de70
Test structure now mirrors project structure.
keevindoherty Aug 2, 2024
fb45183
Update tests.
keevindoherty Aug 2, 2024
541e05a
Add future benchmark dir.
keevindoherty Aug 2, 2024
128351a
Move split edges utility into pose graph utils.
keevindoherty Aug 2, 2024
85e89dd
Update tests and conversion code.
keevindoherty Aug 2, 2024
1a81b82
Fix typo.
keevindoherty Aug 2, 2024
faf1ffc
Test main Laplacian builder function.
keevindoherty Aug 2, 2024
18831c5
WIP tidying Cholesky tests.
keevindoherty Aug 2, 2024
61ebc95
Move Cache to inner class.
keevindoherty Aug 2, 2024
49d3a99
Note on future tests to add.
keevindoherty Aug 2, 2024
7e21f93
Add test for complete graph.
keevindoherty Aug 2, 2024
3b154e3
Add failing test for disconnected component case.
keevindoherty Aug 2, 2024
e69b378
Fixes for optimization code.
keevindoherty Aug 2, 2024
b2ab8ac
Remove unused import.
keevindoherty Aug 2, 2024
7a2691a
Start tests for optimization code.
keevindoherty Aug 2, 2024
7b135db
Fix relative duality gap check, update constraints docs, and add test.
keevindoherty Aug 3, 2024
c75dcab
MAC now working.
keevindoherty Aug 3, 2024
0b1bcf4
Some doc updates and minor cleanup.
keevindoherty Aug 4, 2024
587feef
Add __init__ to support test discovery.
keevindoherty Aug 10, 2024
628be78
Tidying unused names.
keevindoherty Aug 14, 2024
46c27ab
More cleanup.
keevindoherty Oct 8, 2024
6613c4b
Fix comment.
keevindoherty Oct 24, 2024
96f175e
Skip test for unimplemented feature.
keevindoherty Oct 24, 2024
bf5e3b3
Rm old benchmarks dir.
keevindoherty Nov 2, 2024
70c7bf4
Fix bug in cache usage.
keevindoherty Nov 2, 2024
49c1959
Add new benchmarks.
keevindoherty Nov 2, 2024
576c66a
Add pytest-benchmark to deps.
keevindoherty Nov 2, 2024
55be6ad
Clean up for Petersen graph example.
keevindoherty Nov 2, 2024
312ebaf
Everything should be functional now.
keevindoherty Nov 8, 2024
2977f0d
Rm imported GreedyESP depending on cholesky utils.
keevindoherty Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install flake8 pytest pytest-benchmark
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
24 changes: 8 additions & 16 deletions examples/g2o_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import numpy as np
import networkx as nx
from timeit import default_timer as timer
from pose_graph_utils import read_g2o_file, plot_poses, rpm_to_mac, RelativePoseMeasurement, poses_ate_tran, poses_rpe_rot
from pose_graph_utils import split_edges, read_g2o_file, plot_poses, rpm_to_mac, RelativePoseMeasurement, poses_ate_tran, poses_rpe_rot

# MAC requirements
from mac import MAC
from mac.baseline import NaiveGreedy
from mac.greedy_eig import GreedyEig
from mac.greedy_esp import GreedyESP
from mac.utils import split_edges, Edge, round_madow
from mac.solvers import MAC, NaiveGreedy
from mac.utils.graphs import Edge
from mac.utils.rounding import round_madow

import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = True
Expand Down Expand Up @@ -267,14 +265,14 @@ def to_sesync_format(measurements):
# pass

# Make a MAC Solver
mac = MAC(odom_edges, lc_edges, num_poses, use_cache=True, fiedler_method="tracemin_cholesky")
mac = MAC(odom_edges, lc_edges, num_poses, fiedler_method="tracemin_cholesky")

# Make a Naive Solver
naive = NaiveGreedy(lc_edges)

# Make a GreedyEig Solver
if run_greedy:
# greedy_eig = GreedyEig(rpm_to_mac(odom_measurements), rpm_to_mac(lc_measurements), num_poses)
from mac.solvers.greedy_esp import GreedyESP
greedy_esp = GreedyESP(odom_edges, lc_edges, num_poses, lazy=True)

#############################
Expand Down Expand Up @@ -318,7 +316,7 @@ def to_sesync_format(measurements):

# Solve the relaxed maximum algebraic connectivity augmentation problem.
start = timer()
result, unrounded, upper, rtime = mac.fw_subset(w_init, num_lc, max_iters=20, rounding="nearest", return_rounding_time=True)
result, unrounded, upper, rtime = mac.solve(num_lc, w_init, max_iters=20, rounding="nearest", return_rounding_time=True, use_cache=True)
end = timer()
solve_time = end - start
times.append(solve_time)
Expand All @@ -337,14 +335,8 @@ def to_sesync_format(measurements):
# point solution every time.
madow_times.append(solve_time + (end - start) - rtime)

# Solve the relaxed maximum algebraic connectivity augmentation problem.
# Solve the greedy k-edge selection problem
if run_greedy:
# start = timer()
# greedy_eig_result, _ = greedy_eig.subset(num_lc)
# end = timer()
# greedy_eig_times.append(end - start)
# greedy_eig_results.append(greedy_eig_result)

num_lcs = [int(pct_lc * len(lc_measurements)) for pct_lc in percent_lc]
greedy_esp_results, _, greedy_esp_times = greedy_esp.subsets_lazy(num_lcs, verbose=True)
pass
Expand Down
148 changes: 0 additions & 148 deletions examples/g2o_mac_cache.py

This file was deleted.

61 changes: 0 additions & 61 deletions examples/greedy_eig_test.py

This file was deleted.

50 changes: 0 additions & 50 deletions examples/greedy_esp_example.py

This file was deleted.

Loading
Loading