Skip to content

Instantly share code, notes, and snippets.

@CVxTz
Created February 12, 2019 21:24
Show Gist options
  • Save CVxTz/3c3ae0b7108e5c8bc3fa51e5b85ece5e to your computer and use it in GitHub Desktop.
Save CVxTz/3c3ae0b7108e5c8bc3fa51e5b85ece5e to your computer and use it in GitHub Desktop.
def get_features_only_model(n_features, n_classes):
in_ = Input((n_features,))
x = Dense(10, activation="relu", kernel_regularizer=l1(0.001))(in_)
x = Dropout(0.5)(x)
x = Dense(n_classes, activation="softmax")(x)
model = Model(in_, x)
model.compile(loss="sparse_categorical_crossentropy", metrics=['acc'], optimizer="adam")
model.summary()
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment