python - 3d sliding window operation in Theano? -
tl.dr. there 3-dimensional friendly implementation of theano.tensor.nnet.neighbours.images2neibs
?
i perform voxel-wise classification of volume (nxnxn) using neural network takes in nxnxn image, n>n. classify each voxel in volume, have iterate through each voxel. each iterration, obtain , pass neighborhood voxels input neural network. sliding window operation, operation neural network.
while neural network implemented in theano, sliding window implementation in python/numpy. since not pure theano operation, classification takes forever (> 3 hours) classify voxels in 1 volume. 2d sliding window operation, theano has helper method, theano.tensor.nnet.neighbours.images2neibs
, there similar implementation 3-dimensional images?
edit: there existing numpy solutions(1 , 2) n-d sliding window, both use np.lib.stride_tricks.as_strided provide 'views of sliding window', preventing memory issues. in implementation, sliding window arrays being passed numpy (cython) python , theano. boost performance, it's have bypass python.
Comments
Post a Comment