A tensor containing a batch of input feature maps.
A tensor containing the filters that will be convolved with the feature maps.
An operation representing convolutions of input imgs with some kernels.
1 import dopt.core : evaluate; 2 3 auto features = float32([1, 1, 3, 5], [ 4 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 5 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 6 1.0f, 1.0f, 1.0f, 0.0f, 0.0f 7 ]); 8 9 auto filters = float32([1, 1, 1, 2], [ 10 -1.0f, 1.0f 11 ]); 12 13 auto result = convolution(features, filters); 14 15 auto edges = result.evaluate().as!float; 16 17 assert(edges == [ 18 0.0f, 0.0f, 1.0f, 0.0f, 19 0.0f, 0.0f, 1.0f, 0.0f, 20 0.0f, 0.0f, 1.0f, 0.0f 21 ]);
Creates a convolution operation that performs the computation required to implement a convolutional layer.
Currently this operation only implements 2D convolutions.