def changeLayerSize(self, layername, newsize):
        """
        Changes layer size. Newsize must be greater than zero.
        """
        # for all connection from to this layer, change matrix:
        if self.sharedWeights:
            raise AttributeError("shared weights broken")
        for connection in self.connections:
            if connection.fromLayer.name == layername:
                connection.changeSize(  newsize, connection.toLayer.size )
            if connection.toLayer.name == layername:
                connection.changeSize( connection.fromLayer.size, newsize )
        # then, change the actual layer size:
        self.getLayer(layername).changeSize(newsize)
def changeLayerSize ( self , layername , newsize ) : if self . sharedWeights : raise AttributeError ( "shared weights broken" ) for connection in self . connections : if connection . fromLayer . name == layername : connection . changeSize ( newsize , connection . toLayer . size ) if connection . toLayer . name == layername : connection . changeSize ( connection . fromLayer . size , newsize ) self . getLayer ( layername ) . changeSize ( newsize )
Changes layer size. Newsize must be greater than zero.