Backends/SiaNet.Backend.TensorSharp/Cpu/SpatialConvolutionMM.cs
/// <summary>
/// Conv2s the backward filter frame.
/// </summary>
/// <param name="gradOutput">The grad output.</param>
/// <param name="gradWeight">The grad weight.</param>
/// <param name="gradBias">The grad bias.</param>
/// <param name="finput">The finput.</param>
/// <param name="cd">The cd.</param>
Conv2s the backward filter frame.
Conv2s the backward filter frame .
private static void Conv2BackwardFilterFrame(NDArray gradOutput, NDArray gradWeight, NDArray gradBias, NDArray finput, ConvolutionDesc2d cd)
        {
            using (var gradOutput2d = gradOutput.View(gradOutput.Shape[0], gradOutput.Shape[1] * gradOutput.Shape[2]))
            using (var finputT = finput.Transpose())
            {
                Ops.Addmm(gradWeight, 1, gradWeight, 1, gradOutput2d, finputT);
                Ops.Sum(gradBias, gradOutput2d, 1);
            }
        }
private static void Conv2BackwardFilterFrame ( NDArray gradOutput , NDArray gradWeight , NDArray gradBias , NDArray finput , ConvolutionDesc2d cd ) { using ( var gradOutput2d = gradOutput . View ( gradOutput . Shape [ 0 ] , gradOutput . Shape [ 1 ] * gradOutput . Shape [ 2 ] ) ) using ( var finputT = finput . Transpose ( ) ) { Ops . Addmm ( gradWeight , 1 , gradWeight , 1 , gradOutput2d , finputT ) ; Ops . Sum ( gradBias , gradOutput2d , 1 ) ; } }
Conv2s the backward filter frame.
Conv2s the backward filter frame .
gradOutput
NDArray
The grad output.
The grad output .
gradWeight
NDArray
The grad weight.
The grad weight .
gradBias
NDArray
The grad bias.
The grad bias .
finput
NDArray
None
cd
ConvolutionDesc2d
None