Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_convertToOneOfMany in PyBrain

I follow the PyBrain tutorial Classification with Feed-Forward Neural Networks and want to build my own classifier.

I do not understand how _convertToOneOfMany modifies outputs.

Why would initial operation alldata.addSample(input, [klass]) create more than one output neuron per class?

like image 324
user425720 Avatar asked Nov 16 '11 16:11

user425720


3 Answers

nevermind, here is doc explaining this stuff http://pybrain.org/docs/tutorial/datasets.html

like image 110
user425720 Avatar answered Nov 06 '22 17:11

user425720


Target number is [0,1,2], this function translate them to (001,010,100). This is because many algorithms work better if classes are encoded into one output unit per class

like image 28
JunWangCas Avatar answered Nov 06 '22 17:11

JunWangCas


The relevant part in the docs is the page Using Datasets: classification – Datasets for Supervised Classification Training:

When doing classification, many algorithms work better if classes are encoded into one output unit per class, that takes on a certain value if the class is present. As an advanced feature, ClassificationDataSet does this conversion automatically:

However, this is not an satisfying answer as I don't understand either why there should be more than one output neuron per class in the first hand.

Update: I recommend using keras

like image 24
Martin Thoma Avatar answered Nov 06 '22 19:11

Martin Thoma