sparse categorical cross entropy python

Solutions on MaxInterview for sparse categorical cross entropy python by the best coders in the world

showing results for - "sparse categorical cross entropy python"
Aitana
03 Oct 2017
1# example
2model = Sequential([
3    Dense(16, input_shape=(1,), activation='relu'), # the relu activation takes the max between 0 and x
4    Dense(32, activation='relu'),
5    Dense(2, activation='sigmoid'), # the sigmoid activation convert the number into number between 0 to 1
6])
7
8# the loss function is the sparse categorical crossentropy
9model.compile(Adam(lr=0.001), loss='sparse_categorical_crossentropy', metrics=['accuracyt'])
10