コード例 #1
0
ファイル: Correlate.cs プロジェクト: stuarthillary/TheaNet
 public Correlate(Tensor <float> x, Tensor <float> kernel, ConvMode mode = ConvMode.Valid) :
     base("Correlate", x, kernel, mode.Named("mode"))
 {
     if (x.NDim != 1 && kernel.NDim != 1)
     {
         throw new RankException("Expect inputs of dim 1");
     }
     this.mode = mode;
     _shape    = new[] { GetConvolveDim(x.Shape[0], kernel.Shape[0], mode) };
 }
コード例 #2
0
 public Correlate2d(Tensor <float> x, Tensor <float> y, ConvMode mode = ConvMode.Valid) :
     base("Correlate2d", x, y, mode.Named("mode"))
 {
     if (x.NDim != 2 && y.NDim != 2)
     {
         throw new RankException("Expect inputs of dim 2");
     }
     this.mode = mode;
     _shape    = new[] { GetConvolveDim(x.Shape[0], y.Shape[0], mode) };
 }