Skip to content

Commit

Permalink
minimal refactoring in backprop.py
Browse files Browse the repository at this point in the history
  • Loading branch information
abbgrade committed Nov 14, 2012
1 parent 2bfd482 commit 066d552
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pybrain/supervised/trainers/backprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def testOnClassData(self, dataset=None, verbose=False,

def trainUntilConvergence(self, dataset=None, maxEpochs=None, verbose=None,
continueEpochs=10, validationProportion=0.25,
trainingset=None, validationset=None):
trainingData=None, validationData=None):
"""Train the module on the dataset until it converges.
Return the module with the parameters that gave the minimal validation
Expand All @@ -205,13 +205,11 @@ def trainUntilConvergence(self, dataset=None, maxEpochs=None, verbose=None,
dataset = self.ds
if verbose is None:
verbose = self.verbose
if trainingset is None and validationset is None:
if trainingData is None or validationData is None:
# Split the dataset randomly: validationProportion of the samples for
# validation.
trainingData, validationData = (
dataset.splitWithProportion(1 - validationProportion))
else:
trainingData, validationData = trainingset, validationset
if not (len(trainingData) > 0 and len(validationData)):
raise ValueError("Provided dataset too small to be split into training " +
"and validation sets with proportion " + str(validationProportion))
Expand Down

0 comments on commit 066d552

Please sign in to comment.