问题
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?
回答1:
nevermind, here is doc explaining this stuff http://pybrain.org/docs/tutorial/datasets.html
回答2:
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
回答3:
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
来源:https://stackoverflow.com/questions/8154674/converttooneofmany-in-pybrain