Skip to content

Instantly share code, notes, and snippets.

@dcshapiro
Created October 8, 2017 23:45
Show Gist options
  • Save dcshapiro/a82bdaab79e25982e79aa59b85f31e72 to your computer and use it in GitHub Desktop.
Save dcshapiro/a82bdaab79e25982e79aa59b85f31e72 to your computer and use it in GitHub Desktop.
high level idea for a classifier of feature vectors
model = Sequential()
import keras.regularizers as kr
w_reg = kr.WeightRegularizer(l1=amountOfL1, l2=amountOfL2)
model.add(Dense(width, input_dim=x_train.shape[1], activation='relu', W_regularizer=w_reg))
model.add(Dropout(dropoutAmount))
for i in range(layerCount):
model.add(GaussianNoise(noiseLevel))
model.add(Dropout(dropoutAmount))
model.add(Dense(width, activation='relu', W_regularizer=w_reg))
model.add(Dense(y_train.shape[1], activation='relu', W_regularizer=w_reg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment