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
I wanted to compute the gradient of a Dask Array, currently on version 0.16 Python3.5, but it doesn't look like it is implemented. Is there a way to compute the gradient, other than simply using numpy.gradient?
It looks like numpy.gradient is implemented with just straight numpy syntax. It may be that some large sections of it would just transfer over to dask.arrays with small effort.
If someone else doesn't do it, I'll probably implement this. Though it likely won't happen right away, but probably before the next release.
In the interim, would suggest taking a look at dask-ndfilters. It's a little filter library I built on top of Dask and SciPy. It wraps up some common SciPy filters like, gaussian_gradient_magnitude, which may be close to what you want. Also there is generic_filter, which could wrap up something like gradient or just about anything else you can think of. If none of those options cut it, map_overlap is probably sufficient to wrap up NumPy's gradient.
No worries. Given you have already had a go at it, @mccarthyryanc, would be happy to review a PR for gradient if you would be interested in submitting one. :)
Activity
mrocklin commentedon Nov 20, 2017
It looks like
numpy.gradientis implemented with just straight numpy syntax. It may be that some large sections of it would just transfer over to dask.arrays with small effort.jakirkham commentedon Nov 21, 2017
If someone else doesn't do it, I'll probably implement this. Though it likely won't happen right away, but probably before the next release.
In the interim, would suggest taking a look at
dask-ndfilters. It's a little filter library I built on top of Dask and SciPy. It wraps up some common SciPy filters like,gaussian_gradient_magnitude, which may be close to what you want. Also there isgeneric_filter, which could wrap up something likegradientor just about anything else you can think of. If none of those options cut it,map_overlapis probably sufficient to wrap up NumPy'sgradient.burdickjp commentedon Dec 7, 2017
I am also in need of this feature.
jakirkham commentedon Dec 7, 2017
Do you have any thoughts on the approaches outlined above?
mccarthyryanc commentedon Jan 16, 2018
Sorry for the late response, but
map_overlapgets me what I needed. @jakirkham, thanks for the feedback!jakirkham commentedon Jan 16, 2018
No worries. Given you have already had a go at it, @mccarthyryanc, would be happy to review a PR for
gradientif you would be interested in submitting one. :)jakirkham commentedon Apr 24, 2018
Adding an implementation of
gradientfor Dask Arrays in PR ( #3434 ).