265266267268269270271272273274275
Matrix o = new Matrix(4, 1); AparapiConv2D conv = new AparapiConv2DFF(c, 1); conv.calculate(c, i1, o); // most simple case assertEquals(164, o.get(0, 0), 0); assertEquals(184, o.get(0, 1), 0); assertEquals(224, o.get(0, 2), 0);
301302303304305306307308309310311
Matrix o = new Matrix(8, 1); AparapiConv2D conv = new AparapiConv2DFF(c, 1); conv.calculate(c, i1, o); assertEquals(164, o.get(0, 0), 0); assertEquals(184, o.get(0, 1), 0); assertEquals(224, o.get(0, 2), 0); assertEquals(244, o.get(0, 3), 0);
270271272273274275276277278279280
for (int i = 0; i < vp.get(c.getInputLayer()).getSize(); i++) { vp.get(c.getInputLayer()).getElements()[it.next()] = i + 1; } AparapiConv2D conv = new AparapiConv2DFF(c, vp, c.getOutputLayer()); conv.calculate(c, vp, c.getOutputLayer()); // most simple case Tensor o = vp.get(c.getOutputLayer()); assertEquals(164, o.get(0, 0, 0, 0), 0);
294295296297298299300301302303304
for (int i = 0; i < vp.get(c.getInputLayer()).getSize(); i++) { vp.get(c.getInputLayer()).getElements()[it.next()] = i + 1; } AparapiConv2D conv = new AparapiConv2DFF(c, vp, c.getOutputLayer()); conv.calculate(c, vp, c.getOutputLayer()); Tensor o = vp.get(c.getOutputLayer()); assertEquals(164, o.get(0, 0, 0, 0), 0); assertEquals(184, o.get(0, 0, 1, 0), 0);