def forward(self, _units): self._units, self._pooled_inds = self.maxPool(_units) self._outputs = self.activate(self._units) if (not self._child == None): if self._child.type() == 'convolutional': next_units = Layer.convConvForward(self._weights, self._outputs, self._child.getUnits().shape) self._child.forward(next_units) elif self._child.type() == 'fullyconnected': self._child.forward(np.dot(self._outputs.flatten(), self._weights) + self._bias)
def forward(self, _units): self._units = _units self._outputs = self.activate(self._units) if (not self._child == None): if self._child.type() == 'convolutional': next_units = Layer.convConvForward(self._weights, self._units, self._child.getUnits().shape) self._child.forward(next_units) elif self._child.type() == 'pooling': self._child.forward(self._units)