Replies: 2 comments 1 reply
-
When you say "stride of 1" do you mean 1 chunk or 1 data value? Right now it seems like you are getting a scalar per chunk. If you want to have the output be the same shape as the input then you need to adjust your function to return that. Maybe that looks like applying your current function several times within each map_overlap call. |
Beta Was this translation helpful? Give feedback.
-
Dear @jsignell Apologies for not being very clear in my last message. Perhaps this diagram will help explain things a bit: Basically, I have a dask array that has size (2,N,M) and a chunk size of (2,n,m). Each chunk produces a scalar - and I want to slide/stride by window, 1 pixel at a time. Your suggestion of nested This is roughly how I have written it in scikit-learn for now:
Hope my intent is a little clearer. I think the linked issue I could find on this subject is this one: #4659 |
Beta Was this translation helpful? Give feedback.
-
I have a function that takes a chunk and computes a scalar, which I wrap into an array of shape (1,1,1).
Using
map_blocks
, I am able to compute the result pretty easily.and the output has the shape
(1, 92, 144)
Now I try to do the same thing with
map_overlap
and theoverlap
function. First, I do this:then call the
map_overlap
function:However, this results in the same as me applying
map_blocks
(only with different results because of the overlap step.What I actually want to achieve is to slide over the image with a stride of 1 (so that the output image is the same size as input).
However, I don't think I know to use the
map_overlap
orrolling
function to achieve this correctly. Any help would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions