Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a neural network of 3 layers be used for multi-class classification?

In Andres NG's coursera course a neural network that outputs 4 distinct classifications is represented as :

enter image description here

There are 4 layers in this network. Are 4 layers required in order to achieve multi-class classification or will 3 layers suffice ?

like image 846
blue-sky Avatar asked Jan 21 '26 06:01

blue-sky


1 Answers

Multiclass setting has nothing to do with number of hidden layers. You can even remove all of them, and end up with simple multinomial logistic regression (linear model), which can handle multiclass problems just fine. Depth of the network is usually used a kind of architectural heuristic, which is currently known to perform well on wide range of tasks (including images), thus adding more layers might be beneficial for harder problems (and multiclass setting is for sure more complex than binary classification), but, as @jorgenkg already suggested in the comment, this is not required, as even a single hidden layer is enough (in theory!) to model any kind of continuous function up to any desired precision. The "only" problem is whether you will actually ever be able to learn shallow model which performs well, but this is completely different question.

like image 123
lejlot Avatar answered Jan 23 '26 21:01

lejlot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!