Created
February 27, 2015 12:14
-
-
Save mjs2600/ef3dccb0eb261742b802 to your computer and use it in GitHub Desktop.
NN Cost Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Trainer(object): | |
def __init__(self, nn, data, label): | |
self.nn = nn | |
self.data = data | |
self.label = label | |
def __call__(self, weights): | |
from pybrain.utilities import percentError | |
self.nn._setParameters(weights) | |
output = self.nn.activateOnDataset(self.data) | |
return percentError(output, self.label) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment