Commit 256b13c8 authored by Andrey Filippov's avatar Andrey Filippov

modifying convolution in LMA

parent 24c49504
...@@ -488,6 +488,7 @@ public class FactorConvKernel { ...@@ -488,6 +488,7 @@ public class FactorConvKernel {
int conv_len = conv_size * conv_size; int conv_len = conv_size * conv_size;
int sym_rad_m1 = sym_radius - 1; // 7 int sym_rad_m1 = sym_radius - 1; // 7
int sym_rad2 = 2*sym_radius; // 16 int sym_rad2 = 2*sym_radius; // 16
int sym_rad4 = 4*sym_radius; // 32
double [] fX = new double [justConvolved? conv_len: this.weight.length]; double [] fX = new double [justConvolved? conv_len: this.weight.length];
// calculate convolution, for kernels - regardless of kernels enabled/disabled // calculate convolution, for kernels - regardless of kernels enabled/disabled
// calculate convolution part // calculate convolution part
...@@ -502,6 +503,7 @@ public class FactorConvKernel { ...@@ -502,6 +503,7 @@ public class FactorConvKernel {
int si = (ci - ai) - sym_rad_m1; int si = (ci - ai) - sym_rad_m1;
if (si < 0) si = -si; if (si < 0) si = -si;
int sgni = 1; int sgni = 1;
if (si > sym_rad2) si = sym_rad4 - si;
if (si > sym_radius) { if (si > sym_radius) {
sgni = -1; sgni = -1;
si = sym_rad2 - si; si = sym_rad2 - si;
...@@ -513,6 +515,7 @@ public class FactorConvKernel { ...@@ -513,6 +515,7 @@ public class FactorConvKernel {
int sj = (cj - aj) - sym_rad_m1; int sj = (cj - aj) - sym_rad_m1;
if (sj < 0) sj = -sj; if (sj < 0) sj = -sj;
int sgn = sgni; int sgn = sgni;
if (sj > sym_rad2) sj = sym_rad4 - sj;
if (sj > sym_radius) { if (sj > sym_radius) {
sgn = -sgn; sgn = -sgn;
sj = sym_rad2 - sj; sj = sym_rad2 - sj;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment