Last active
October 2, 2019 12:13
-
-
Save L-Lewis/8ced87ef8742cec921759d4d7348b2a5 to your computer and use it in GitHub Desktop.
This file contains 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
from keras.models import Sequential | |
from keras.layers.core import Dense | |
def create_mlp(dim, regularizer=None): | |
"""Creates a simple two-layer MLP with inputs of the given dimension""" | |
model = Sequential() | |
model.add(Dense(8, input_dim=dim, activation="relu", kernel_regularizer=regularizer)) | |
model.add(Dense(4, activation="relu", kernel_regularizer=regularizer)) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment