PLearn 0.1
Namespaces | Functions
convolutions.cc File Reference
#include "convolutions.h"
Include dependency graph for convolutions.cc:

Go to the source code of this file.

Namespaces

namespace  PLearn
 

< for swap


Functions

void PLearn::convolve1D (const Vec &source_signal, const Vec &kernel, const Vec &dest_signal, int step=1, bool accumulate=true)
 Convolve a source signal of length NS with a kernel of length NK with steps S, and put result in a destination signal which should be of length NS-NK+1.
void PLearn::backConvolve1D (const Vec &source_signal, const Vec &kernel, const Vec &dest_signal, int step=1, bool accumulate=true)
 Back-convolve INTO a "source" signal of length NS with a kernel of length NK and FROM a "destination" signal which should be of length NS-NK+1 This is EXACTLY the TRANSPOSE operation of a convolve1D with the same arguments, with computations flowing in the other direction.
void PLearn::convolve1Dbackprop (const Vec &source_signal, const Vec &kernel, const Vec &dC_ddest_signal, const Vec &dC_dsource_signal, const Vec &dC_dkernel, int step=1, bool accumulate=true)
 Increment dC/dsource_signal and dC/dkernel, given dC/ddest_signal, with dest_signal computed as per convolve1D(source_signal, kernel, dest_signal): dC/dsource_signal[k] += sum_{j=0}^{NK-1} 1_{k>=j && k-j<ND} dC_ddest_signal[k-j]*kernel[j] dC/dkernel[j] += sum_{k=0}^{ND-1} 1_{k>=j && k-j<ND} dC_ddest_signal[k-j]*source_signal[k] (consider the equivalence: k = i+j)
void PLearn::convolve1Dbackprop (const Vec &source_signal, const Vec &dC_ddest_signal, const Vec &dC_dkernel, int step=1, bool accumulate=true)
 Same as above, but increments only dC/dkernel, not dC/dsource_signal dC/dkernel[j] += sum_{k=0}^{ND-1} 1_{k>=j && k-j<ND} dC_ddest_signal[k-j]*source_signal[k] (consider the equivalence: k = i+j)
void PLearn::backConvolve1Dbackprop (const Vec &kernel, const Vec &dest_signal, const Vec &dC_ddest_signal, const Vec &dC_dsource_signal, const Vec &dC_dkernel, int step=1, bool accumulate=true)
 Increment dC/ddest_signal and dC/dkernel, given dC/ddest_signal, with source_signal computed as per backConvolve1D(source_signal, kernel, dest_signal): dC/ddest_signal[i] += sum_{j=0}^{NK-1} dC_dsource_signal[i+j]*kernel[j] dC/dkernel[j] += sum_{i=0}^{ND-1} dC_dsource_signal[i+j]*dest_signal[i].
void PLearn::backConvolve1Dbackprop (const Vec &dest_signal, const Vec &dC_dsource_signal, const Vec &dC_dkernel, int step=1, bool accumulate=true)
 Same as above, but increments only dC/dkernel, not dC/ddest_signal dC/dkernel[j] += sum_{i=0}^{ND-1} dC_dsource_signal[i+j]*dest_signal[i].
void PLearn::convolve2D (const Mat &source_image, const Mat &kernel, const Mat &dest_image, int step1=1, int step2=1, bool accumulate=true)
 Convolve a (N1S x N2S) source image with a (N1K x N2K) kernel matrix, and put result in a destination matrix of dimensions (N1D x N2D), stepping by (step1,step2) in each direction, with NiS = NiD*stepi + NiK - 1.
void PLearn::backConvolve2D (const Mat &source_image, const Mat &kernel, const Mat &dest_image, int step1=1, int step2=1, bool accumulate=true)
 Back-convolve INTO a (N1S x N2S) "source" image with a (N1K x N2K) kernel matrix, and FROM a "destination" image of dimensions (N1D x N2D), with NiS = NiD + NiK - 1.
void PLearn::convolve2Dbackprop (const Mat &source_image, const Mat &kernel, const Mat &dC_ddest_image, const Mat &dC_dsource_image, const Mat &dC_dkernel, int step1=1, int step2=1, bool accumulate=true)
 Increment dC/dsource_image and dC/dkernel, given dC/ddest_image, with dest_image computed as per convolve2D(source_image, kernel, dest_image): for i1=0 to N1D-1: for i2=0 to N2D-1: for j1=0 to N1K-1: for j2=0 to N2K-1: dC/dsource_image[i1+j1,i2+j2] += dC/dest_image[i1,i2]*kernel[j1,j2] dC/dkernel[j1,j2] += dC/dest_image[i1,i2]*source_image[i1+j1,i2+j2].
void PLearn::convolve2Dbackprop (const Mat &source_image, const Mat &dC_ddest_image, const Mat &dC_dkernel, int step1=1, int step2=1, bool accumulate=true)
 As above, but increments only dC/dkernel, not dC/dsource_image for i1=0 to N1D-1: for i2=0 to N2D-1: for j1=0 to N1K-1: for j2=0 to N2K-1: dC/dkernel[j1,j2] += dC/dest_image[i1,i2]*source_image[i1+j1,i2+j2].
void PLearn::backConvolve2Dbackprop (const Mat &kernel, const Mat &dest_image, const Mat &dC_ddest_image, const Mat &dC_dsource_image, const Mat &dC_dkernel, int step1=1, int step2=1, bool accumulate=true)
 Increment dC/ddest_image and dC/dkernel, given dC/dsource_image, with source_image computed as per backConvolve2D(source_image, kernel, dest_image): for i1=0 to N1D-1: for i2=0 to N2D-1: for j1=0 to N1K-1: for j2=0 to N2K-1: dC/ddest_image[i1,i2] += dC/dsource_image[i1+j1,i2+j2]*kernel[j1,j2] dC/dkernel[j1,j2] += dC/dsource_image[i1+j1,i2+j2]*dest_image[i1,i2].
void PLearn::backConvolve2Dbackprop (const Mat &dest_image, const Mat &dC_dsource_image, const Mat &dC_dkernel, int step1=1, int step2=1, bool accumulate=true)
 As above, but increments only dC/dkernel, not dC/ddest_image for i1=0 to N1D-1: for i2=0 to N2D-1: for j1=0 to N1K-1: for j2=0 to N2K-1: dC/dkernel[j1,j2] += dC/dsource_image[i1+j1,i2+j2]*dest_image[i1,i2].

Detailed Description

Definition in file convolutions.cc.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines