示例#1
0
 void deconvolution(float[,] input)
 {
     float[,] f = ConvFuncs.back_fold(input, weights, outputwidth, outputheight, w, h);
     for (int j = 0; j < outputheight; j++)
     {
         for (int i = 0; i < outputwidth; i++)
         {
             non_activated_stage[i, j] = f[i, j];
             output[i, j] = ActFuncs.f_act_sigma(f[i, j]);
             deriv_non_activated_stage[i, j] = ActFuncs.f_act_sigma_deriv(non_activated_stage[i, j]);
         }
     }
 }
 //get error from only connected next convolutional map
 public void get_map_error_from_convolution(ConvolutionFeatureMap next_l_fm)
 {//W transp*sigma_prev*f_derived(ul)
     this.error = new float[outputwidth, outputheight];
     //1) get deconvolution (back fold) of next layer's error
     float[,] summfold = ConvFuncs.back_fold(next_l_fm.error, next_l_fm.weights, next_l_fm.outputwidth, next_l_fm.outputheight, next_l_fm.w, next_l_fm.h);
     for (int j = 0; j < outputheight; j++)
     {
         for (int i = 0; i < outputwidth; i++)
         {
             error[i, j] = ActFuncs.f_act_linear_deriv(non_activated_stage[i, j]) * summfold[i, j];
             b          += error[i, j];
         }
     }
 }