Skip to content

FMQA fixes #7

Open
peterkim01 wants to merge 28 commits intoSECQUOIA:mainfrom
peterkim01:main
Open

FMQA fixes #7
peterkim01 wants to merge 28 commits intoSECQUOIA:mainfrom
peterkim01:main

Conversation

@peterkim01
Copy link
Member

FMQA now trains properly with 2D graphs.

  • Speed and accuracy improved
    Fixes to setup.py and README.

Copy link
Member

@bernalde bernalde left a comment

Choose a reason for hiding this comment

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

There are a number of recommended changes but this is looking good. I will request a copilot revision and make sure to merge the changes made to README

max_cycles = 100
convergence_patience = 10
max_cycles = 150
convergence_patience = int(len(grid) * 0.01)
Copy link
Member

Choose a reason for hiding this comment

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

This factor you are using should be an important parameter to change early on the code and not be hardcoded or hidden

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the FMQA implementation to better support 2D (and some 3D) grid datasets, adds a utility for generating benchmark 2D grids, and refreshes packaging/README content.

Changes:

  • Added 3D grid loading/encoding helpers and a 3D objective lookup in read_grid.py.
  • Refactored the simulated-annealing surrogate solve path and updated the simulated runner to log runs + save plots.
  • Updated packaging metadata (setup.py) and expanded the README; removed large dataset/log CSV artifacts from the repo.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
bbo_via_fmqa/setup.py Switches packaging to py_modules, adjusts dependencies, adds console entry points.
bbo_via_fmqa/read_grid.py Adds 3D grid support utilities + formatting fixes.
bbo_via_fmqa/qhd_grid_generator.py New 2D benchmark grid CSV generator for various objective landscapes.
bbo_via_fmqa/ising_machine.py Adds SA-based surrogate solvers (2D + 3D).
bbo_via_fmqa/fmqa_simulated.py Updates SA loop, logging, convergence logic, and plot saving.
bbo_via_fmqa/fmqa_qci.py Updates surrogate import path.
bbo_via_fmqa/fmqa_dwave.py Updates surrogate import path; removes commented-out surrogate test block.
bbo_via_fmqa/FM_surrogate.py Makes training accept precomputed feature vectors and reduces epochs.
README.md Replaces README with a longer algorithm overview + setup/structure sections.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-28-31.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-26-32.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-24-34.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-22-00.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-19-55.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-17-08.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-15-02.csv Deleted log artifact.
bbo_via_fmqa/output/fmqa_dwave_log_2025-12-04_15-12-52.csv Deleted log artifact.
bbo_via_fmqa/output/archive/fmqa_dwave_log_2025-11-27_17-10-48.csv Deleted archived log artifact.
bbo_via_fmqa/output/archive/fmqa_dwave_log_2025-11-27_14-35-14.csv Deleted archived log artifact.
bbo_via_fmqa/output/archive/fmqa_dwave_log_2025-11-27_14-32-58.csv Deleted archived log artifact.
bbo_via_fmqa/output/archive/fmqa_dwave_log_2025-11-27_14-28-14.csv Deleted archived log artifact.
bbo_via_fmqa/output/archive/fmqa_dwave_log_2025-11-27_14-25-48.csv Deleted archived log artifact.
bbo_via_fmqa/output/archive/fmqa_dwave_log_2025-11-27_14-23-53.csv Deleted archived log artifact.
bbo_via_fmqa/dataset/compl_enum_cstr_34_baron_bigm.csv Deleted dataset artifact.
bbo_via_fmqa/dataset/compl_enum_cstr_30_baron_hull.csv Deleted dataset artifact.
bbo_via_fmqa/dataset/compl_enum_cstr_17_baron_hull.csv Deleted dataset artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

peterkim01 and others added 5 commits March 3, 2026 12:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@bernalde bernalde left a comment

Choose a reason for hiding this comment

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

There are a number of open comments from the previous review of mine and copilot plus this new ones. Please respond them all, and make sure to fix the merge conflict with the README file

# --- Parameters ---
max_cycles = 150
convergence_patience = int(len(grid) * 0.01)
convergence_patience = max(1, int(len(grid) * 0.01))
Copy link
Member

Choose a reason for hiding this comment

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

This 0.01 should be a parameter to be set early in the file or through some external argument as it is something we want to change

@@ -378,10 +411,29 @@ def solve_surrogate_SA(fm_model, x_bound, y_bound, evaluated_points, sampler, gr

def solve_surrogate_SA_3d(fm_model, x_bound, y_bound, z_bound, evaluated_points, sampler, grid):
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have a separate 3D and 2D function? Doesn't the logic apply the same?

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.

4 participants