"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "skimage/segmentation/random_walker_segmentation.py" between
scikit-image-0.18.1.tar.gz and scikit-image-0.18.3.tar.gz

About: scikit-image is a collection of algorithms for image processing in Python.

random_walker_segmentation.py  (scikit-image-0.18.1):random_walker_segmentation.py  (scikit-image-0.18.3)
skipping to change at line 191 skipping to change at line 191
warn('"cg" mode may be slow because UMFPACK is not available. ' warn('"cg" mode may be slow because UMFPACK is not available. '
'Consider building Scipy with UMFPACK or use a ' 'Consider building Scipy with UMFPACK or use a '
'preconditioned version of CG ("cg_j" or "cg_mg" modes).', 'preconditioned version of CG ("cg_j" or "cg_mg" modes).',
stacklevel=2) stacklevel=2)
M = None M = None
elif mode == 'cg_j': elif mode == 'cg_j':
M = sparse.diags(1.0 / lap_sparse.diagonal()) M = sparse.diags(1.0 / lap_sparse.diagonal())
else: else:
# mode == 'cg_mg' # mode == 'cg_mg'
lap_sparse = lap_sparse.tocsr() lap_sparse = lap_sparse.tocsr()
ml = ruge_stuben_solver(lap_sparse) ml = ruge_stuben_solver(lap_sparse, coarse_solver='pinv')
M = ml.aspreconditioner(cycle='V') M = ml.aspreconditioner(cycle='V')
maxiter = 30 maxiter = 30
cg_out = [ cg_out = [
cg(lap_sparse, B[:, i].toarray(), tol=tol, M=M, maxiter=maxiter) cg(lap_sparse, B[:, i].toarray(), tol=tol, M=M, maxiter=maxiter)
for i in range(B.shape[1])] for i in range(B.shape[1])]
if np.any([info > 0 for _, info in cg_out]): if np.any([info > 0 for _, info in cg_out]):
warn("Conjugate gradient convergence to tolerance not achieved. " warn("Conjugate gradient convergence to tolerance not achieved. "
"Consider decreasing beta to improve system conditionning.", "Consider decreasing beta to improve system conditionning.",
stacklevel=2) stacklevel=2)
X = np.asarray([x for x, _ in cg_out]) X = np.asarray([x for x, _ in cg_out])
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)