We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I ran into an error when running examples/scripts/ct_astra_weighted_tv_admm.py. It seems to be the case that in
examples/scripts/ct_astra_weighted_tv_admm.py
scico/scico/functional/_norm.py
Lines 102 to 105 in 4381be5
v
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~/pythonModules/scico/examples/scripts/ct_astra_weighted_tv_admm.py in <module> 123 ) 124 print(f"Solving on {device_info()}\n") --> 125 admm_unweighted.solve() 126 x_unweighted = postprocess(admm_unweighted.x) 127 ~/pythonModules/scico/scico/optimize/admm.py in solve(self, callback) 679 for self.itnum in range(self.itnum, self.itnum + self.maxiter): 680 self.step() --> 681 self.itstat_object.insert(self.itstat_insert_func(self)) 682 if callback: 683 self.timer.stop() <string> in itstat_func(obj) ~/pythonModules/scico/scico/optimize/admm.py in norm_dual_residual(self) 579 out = 0.0 580 for zi, ziold, Ci in zip(self.z_list, self.z_list_old, self.C_list): --> 581 out += norm(Ci.adj(zi - ziold)) ** 2 582 return snp.sqrt(out) 583 ~/pythonModules/scico/scico/_generic_operators.py in adj(self, y) 600 return ComposedLinearOperator(self.H, y) 601 if self.output_dtype != y.dtype: --> 602 raise ValueError(f"dtype error: expected {self.output_dtype}, got {y.dtype}") 603 if self.output_shape != y.shape: 604 raise ValueError( ValueError: dtype error: expected float32, got complex64
This is an issue that only arises after #259.
scico/scico/optimize/admm.py
Line 657 in 4381be5
zi
snp.iscomplexobj
git checkout 4ac440a (before Simplify BlockArray implementation (#259))
git checkout 4ac440a
BlockArray
In [22]: a = BlockArray.array([snp.zeros(2), snp.ones(2)]) In [23]: a Out[23]: scico.blockarray.BlockArray: DeviceArray([0., 0., 1., 1.], dtype=float32) In [24]: snp.iscomplexobj(a) Out[24]: False
git checkout 4381be5 (after Simplify BlockArray implementation (#259))
git checkout 4381be5
In [2]: a = snp.blockarray([snp.zeros(2), snp.ones(2)]) In [3]: a Out[3]: [DeviceArray([0., 0.], dtype=float32), DeviceArray([1., 1.], dtype=float32)] In [4]: snp.iscomplexobj(a) Out[4]: [DeviceArray(False, dtype=bool), DeviceArray(False, dtype=bool)] In [5]: bool(snp.iscomplexobj(a)) Out[5]: True
@bwohlberg
The text was updated successfully, but these errors were encountered:
Michael-T-McCann
Successfully merging a pull request may close this issue.
I ran into an error when running
examples/scripts/ct_astra_weighted_tv_admm.py
.It seems to be the case that in
scico/scico/functional/_norm.py
Lines 102 to 105 in 4381be5
the if-clause gets executed (because
v
is a BlockArray, see below) and the arrays get converted to complex64, causing the following output:This is an issue that only arises after #259.
scico/scico/optimize/admm.py
Line 657 in 4381be5
zi
is a BlockArray, whereas in previous commits it is not. Why?snp.iscomplexobj
is not the same as shown below. Is this desired?git checkout 4ac440a
(before SimplifyBlockArray
implementation (#259))git checkout 4381be5
(after SimplifyBlockArray
implementation (#259))@bwohlberg
The text was updated successfully, but these errors were encountered: