👽
computer visions
Pinned Loading
-
-
numpy-is-all-you-need
numpy-is-all-you-need PublicAn encoder-decoder transformer model written in numpy.
Jupyter Notebook
-
-
one line n-dimensional convolution i...
one line n-dimensional convolution in numpy 1import numpy as np
23# even if it wraps, it is still one line :)
4conv = lambda img, ker, stride, dilation: (img[tuple(np.expand_dims(np.indices(ker.shape) * np.expand_dims(dilation, at_end := tuple(range(-ker.ndim, 0))), tuple(range(1, ker.ndim+1))) + np.expand_dims(np.indices((img.shape - dilation * (np.array(ker.shape) - 1) - 1) // stride + 1) * np.expand_dims(stride, at_end), at_end))] * ker).sum(at_end)
5 -
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.