def ce_init(self):
        """
        Initializes error computation. Calculates error for output
        layers and initializes hidden layer error to zero.
        """
        retval = 0.0; correct = 0; totalCount = 0
        for layer in self.layers:
            if layer.active:
                if layer.type == 'Output':
                    layer.error = self.errorFunction(layer.target, layer.activation) 
                    totalCount += layer.size
                    retval += Numeric.add.reduce((layer.target - layer.activation) ** 2)
                    correct += Numeric.add.reduce(Numeric.fabs(layer.target - layer.activation) < self.tolerance)
                elif (layer.type == 'Hidden'):
                    for i in range(layer.size): # do it this way so you don't break reference links
                        layer.error[i] = 0.0
        return (retval, correct, totalCount)
def ce_init ( self ) : retval = 0.0 ; correct = 0 ; totalCount = 0 for layer in self . layers : if layer . active : if layer . type == 'Output' : layer . error = self . errorFunction ( layer . target , layer . activation ) totalCount += layer . size retval += Numeric . add . reduce ( ( layer . target - layer . activation ) ** 2 ) correct += Numeric . add . reduce ( Numeric . fabs ( layer . target - layer . activation ) < self . tolerance ) elif ( layer . type == 'Hidden' ) : for i in range ( layer . size ) : layer . error [ i ] = 0.0 return ( retval , correct , totalCount )
Initializes error computation. Calculates error for output
        layers and initializes hidden layer error to zero.