pytorch_fnet icon indicating copy to clipboard operation
pytorch_fnet copied to clipboard

Specify dimension requirement

Open jxchen01 opened this issue 5 years ago • 4 comments

It looks like there is a requirement on the minimum number of z slices.

"ValueError: Input array must be at least length 32 in first dimension"

When batch-processing on a large set of images, it would be great to skip the "bad" image and raise a flag, rather than assertion fail.

jxchen01 avatar Apr 03 '19 04:04 jxchen01

Do we know why there is a requirement for a minimum number of z stacks to be 32? In the nature methods paper, I do not see why 32 z stacks were required.

ateneyck1 avatar Oct 13 '21 15:10 ateneyck1

Do we know why there is a requirement for a minimum number of z stacks to be 32? In the nature methods paper, I do not see why 32 z stacks were required.

Dear @ateneyck1 , z >= 32 is required by the model. Namely, after certain number of pooling layers, if the number of z is too small, a numerical error will occur.

jxchen01 avatar Oct 15 '21 09:10 jxchen01

@jxchen01 do you know where the pooling layers are defined?

ateneyck1 avatar Oct 19 '21 18:10 ateneyck1

@jxchen01 do you know where the pooling layers are defined?

Actually, it is convolution with stride = 2. See: https://github.com/AllenCellModeling/pytorch_fnet/blob/master/fnet/nn_modules/fnet_nn_3d_params.py#L51

The number of such layers is defined by depth: https://github.com/AllenCellModeling/pytorch_fnet/blob/master/fnet/nn_modules/fnet_nn_3d_params.py#L7

jxchen01 avatar Oct 19 '21 19:10 jxchen01