Created
October 16, 2019 16:28
-
-
Save santhalakshminarayana/120201dcbc208709921a31bdcaa037da to your computer and use it in GitHub Desktop.
Face recognition softmax classifier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Softmax regressor to classify images based on encoding | |
classifier_model=Sequential() | |
classifier_model.add(Dense(units=100,input_dim=x_train.shape[1],kernel_initializer='glorot_uniform')) | |
classifier_model.add(BatchNormalization()) | |
classifier_model.add(Activation('tanh')) | |
classifier_model.add(Dropout(0.3)) | |
classifier_model.add(Dense(units=10,kernel_initializer='glorot_uniform')) | |
classifier_model.add(BatchNormalization()) | |
classifier_model.add(Activation('tanh')) | |
classifier_model.add(Dropout(0.2)) | |
classifier_model.add(Dense(units=6,kernel_initializer='he_uniform')) | |
classifier_model.add(Activation('softmax')) | |
classifier_model.compile(loss=tf.keras.losses.SparseCategoricalCrossentropy(),optimizer='nadam',metrics=['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment