Skip to content

modified logging to use python lists rather than preallocated arrays - #60

Open
kamdh wants to merge 1 commit into
drrelyea:masterfrom
kamdh:logging_iters
Open

modified logging to use python lists rather than preallocated arrays#60
kamdh wants to merge 1 commit into
drrelyea:masterfrom
kamdh:logging_iters

Conversation

@kamdh

@kamdh kamdh commented Jul 29, 2026

Copy link
Copy Markdown

This is more pythonic and there was a bug with previous preallocation. The info is still returned as a numpy array. I've attached a minimal example that reproduces the error with the saved data.

Error:

NpzFile 'temp_data.npz' with keys: theta, y
Linesearch failed with error 1. Damping max BB scaling to 10000.0
Linesearch failed with error 1. Damping max BB scaling to 1000.0
Linesearch failed with error 1. Damping max BB scaling to 100.0
Linesearch failed with error 1. Damping max BB scaling to 10.0
Linesearch failed with error 1. Damping max BB scaling to 1.0
Linesearch failed with error 1. Damping max BB scaling to 0.1
Traceback (most recent call last):
  File "/home/kameron/src/Visual-Compressive-Sensing/err_ex_spgl1.py", line 10, in <module>
    s, r, g, info = spg_bp(A, b, iter_lim=10240)
  File "/home/kameron/src/Visual-Compressive-Sensing/.venv/lib/python3.10/site-packages/spgl1/spgl1.py", line 1495, in spg_bp
    x, r, g, info = spgl1(A, b, tau, sigma, x0, **kwargs)
  File "/home/kameron/src/Visual-Compressive-Sensing/.venv/lib/python3.10/site-packages/spgl1/spgl1.py", line 1189, in spgl1
    xnorm1[niters] = primal_norm(x, weights)
IndexError: index 10240 is out of bounds for axis 0 with size 10240

min_err_example.zip

… as this is more pythonic and there was a bug with previous preallocation
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.

1 participant