You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cuqi/experimental/mcmc/_rto.py
+53-9Lines changed: 53 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -36,21 +36,48 @@ class LinearRTO(Sampler):
36
36
tol : float
37
37
Tolerance of the inner CGLS solver. *Optional*.
38
38
39
+
inner_initial_point : string or np.ndarray or cuqi.array.CUQIArray
40
+
Initial point for the inner optimization problem. Can be "previous_sample" (default), "MAP", or a specific numpy or cuqi array. *Optional*.
41
+
39
42
callback : callable, optional
40
43
A function that will be called after each sampling step. It can be useful for monitoring the sampler during sampling.
41
44
The function should take three arguments: the sampler object, the index of the current sampling step, the total number of requested samples. The last two arguments are integers. An example of the callback function signature is: `callback(sampler, sample_index, num_of_samples)`.
sim=CGLS(self.M, y, self.current_point, self.maxit, self.tol)
148
+
sim=CGLS(self.M, y, self.inner_initial_point, self.maxit, self.tol)
118
149
self.current_point, _=sim.solve()
119
150
acc=1
120
151
returnacc
@@ -203,12 +234,15 @@ class RegularizedLinearRTO(LinearRTO):
203
234
solver : string
204
235
Options are "FISTA" (default for a single constraint or regularization), "ADMM" (default and the only option for multiple constraints or regularizations), "ScipyLinearLSQ" and "ScipyMinimizer". Note "ScipyLinearLSQ" and "ScipyMinimizer" can only be used with `RegularizedGaussian` of a single `box` or `nonnegativity` constraint. *Optional*.
205
236
237
+
inner_initial_point : string or np.ndarray or cuqi.array.CUQIArray
238
+
Initial point for the inner optimization problem. Can be "previous_sample" (default), "MAP", or a specific numpy or cuqi array. *Optional*.
239
+
206
240
callback : callable, optional
207
241
A function that will be called after each sampling step. It can be useful for monitoring the sampler during sampling.
208
242
The function should take three arguments: the sampler object, the index of the current sampling step, the total number of requested samples. The last two arguments are integers. An example of the callback function signature is: `callback(sampler, sample_index, num_of_samples)`.
0 commit comments