예제 #1
0
파일: ANN_loader.py 프로젝트: mk2908/WSD
    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)