官术网_书友最值得收藏!

The softmax function

The softmax function is mainly used to handle classification problems and preferably used in the output layer, outputting the probabilities of the output classes. As seen earlier, while solving the binary logistic regression, we witnessed that the sigmoid function was able to handle only two classes. In order to handle multi-class we need a function that can generate values for all the classes and those values follow the rules of probability. This objective is fulfilled by the softmax function, which shrinks the outputs for each class between 0 and 1 and divides them by the sum of the outputs for all the classes:

For examples, , where x refers to four classes.

Then, the softmax function will gives results (rounded to three decimal places) as:

Thus, we see the probabilities of all the classes. Since the output of every classifier demands probabilistic values for all the classes, the softmax function becomes the best candidate for the outer layer activation function of the classifier.

主站蜘蛛池模板: 旌德县| 苏州市| 嘉定区| 桃江县| 临邑县| 神池县| 西畴县| 连云港市| 错那县| 通许县| 射阳县| 德保县| 苏尼特右旗| 西乌| 固始县| 宝山区| 丰城市| 临朐县| 兴安县| 崇文区| 正蓝旗| 汤原县| 宝山区| 五常市| 南乐县| 垫江县| 资阳市| 呼图壁县| 垣曲县| 察雅县| 东丰县| 陕西省| 宁陕县| 礼泉县| 武汉市| 大悟县| 进贤县| 准格尔旗| 大足县| 巴林左旗| 深圳市|