Created
August 26, 2016 14:34
-
-
Save jskDr/f3007817baf54f249e6138fbd384eeea to your computer and use it in GitHub Desktop.
Reguralization of a dense layer in Kreas
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
model = Sequential() | |
model.add(Dense( l[1], input_shape=(l[0],))) | |
for n_w_l in l[2:]: | |
model.add(Activation('relu')) | |
model.add(Dense( n_w_l, W_regularizer = l2(.01))) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment