Search code examples
pythonmachine-learningneural-networkpybrain

How to implement regularization in pybrain


Anyone can give a sample coding of implementing regularization technique in pybrain? I am trying to prevent overfitting in my data and currently looking for a method like early stopping, etc to do so. Thanks!


Solution

  • There is a weight decay variable which is the L2 regularization in pybrain. Apart from that, I would implement early stopping as a combination to the weight decay term.

    Below is how you'd specify the weight decay.

    trainer = RPropMinusTrainer(net, dataset=trndata, verbose=True, weightdecay=0.01)