Skip to content

Instantly share code, notes, and snippets.

@jskDr
Created August 26, 2016 14:34
Show Gist options
  • Save jskDr/f3007817baf54f249e6138fbd384eeea to your computer and use it in GitHub Desktop.
Save jskDr/f3007817baf54f249e6138fbd384eeea to your computer and use it in GitHub Desktop.
Reguralization of a dense layer in Kreas
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