def _addLayer(self, type, neurons): # add empty neurons """Add a layer to the network of a specified type. Complain if there is no support for the specified type.""" if ('input' == type): self._currentlayer = self._inputlayer = ANN.InputLayer( int(neurons)) elif ('hidden' == type): self._currentlayer = ANN.HiddenLayer(int(neurons)) self._hiddenlayers.append(self._currentlayer) elif ('output' == type): self._currentlayer = self._outputlayer = ANN.OutputLayer( int(neurons)) else: raise Exception('Unsupported layer type : ' + type)