18
18
19
19
def convolve2GradientNN (incoming_gradient , original_signal , original_kernel , convolved_output , stride = (1 , 1 ), padding = (0 , 0 ), dilation = (1 , 1 ), gradType = CONV_GRADIENT .DEFAULT ):
20
20
"""
21
- This version of convolution is consistent with the machine learning
22
- formulation that will spatially convolve a filter on 2-dimensions against a
23
- signal. Multiple signals and filters can be batched against each other.
24
- Furthermore, the signals and filters can be multi-dimensional however their
25
- dimensions must match.
21
+ Function for calculating backward pass gradient of 2D convolution.
22
+
23
+ This function calculates the gradient with respect to the output of the
24
+ \r ef convolve2NN() function that uses the machine learning formulation
25
+ for the dimensions of the signals and filters
26
+
27
+ Multiple signals and filters can be batched against each other, however
28
+ their dimensions must match.
26
29
27
30
Example:
28
31
Signals with dimensions: d0 x d1 x d2 x Ns
@@ -33,12 +36,18 @@ def convolve2GradientNN(incoming_gradient, original_signal, original_kernel, con
33
36
Parameters
34
37
-----------
35
38
36
- signal: af.Array
39
+ incoming_gradient: af.Array
40
+ - Gradients to be distributed in backwards pass
41
+
42
+ original_signal: af.Array
37
43
- A 2 dimensional signal or batch of 2 dimensional signals.
38
44
39
- kernel : af.Array
45
+ original_kernel : af.Array
40
46
- A 2 dimensional kernel or batch of 2 dimensional kernels.
41
47
48
+ convolved_output: af.Array
49
+ - output of forward pass of convolution
50
+
42
51
stride: tuple of ints. default: (1, 1).
43
52
- Specifies how much to stride along each dimension
44
53
0 commit comments