Skip to content

Instantly share code, notes, and snippets.

@wiccy46
Created March 28, 2020 15:47
Show Gist options
  • Save wiccy46/ab177d42357518da0f31729b5dcd57c2 to your computer and use it in GitHub Desktop.
Save wiccy46/ab177d42357518da0f31729b5dcd57c2 to your computer and use it in GitHub Desktop.
[MLP] Simple MLP example #python #tensorflow
model = Sequential()
model.add(Dense(256, input_shape=(40, )))
model.add(Acitivation('relu'))
model.add(Dropout(0.5))
model.add(Dense(256))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(num_labels))
model.add(Activation('softmax'))
# Compile the model
model.compile(loss='categorical_crossentropy',
metrics=['accuracy'], optimizer='adam')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment