_convertToOneOfMany in PyBrain

不问归期 提交于 2019-12-08 17:22:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!