作者:KING逊咖 | 来源:互联网 | 2024-11-15 10:50
1.Softmaxisanon-linearactivationfunctiongenerallyusedasthelastlayerofaclassificationmodelt
1. Softmax is a non-linear activation function generally used as the last layer of a classification model
the defination and formula of softmax is:
from the following example, we can see this network use softmax layer as the last layer to output 10 probability value
from keras import models
from keras import layers
network = models.Sequential() # sequential model
network.add(layers.Dense(512, activation='relu', input_shape=(28*28,)))
network.add(layers.Dense(10, activation='softmax'))