SHARE
TWEET

Untitled

a guest Mar 20th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Build neural network
  2. # Neural net with multiple layers
  3. model = Sequential()
  4.  
  5. model.add(Dense(32, input_dim=17, init='uniform', activation='sigmoid'))
  6. model.add(Dense(64, init='uniform', activation='relu'))
  7. model.add(Dense(64, init='uniform', activation='relu'))
  8. model.add(Dense(64, init='uniform', activation='relu'))
  9. model.add(Dense(32, init='uniform', activation='relu'))
  10. model.add(Dense(16, init='uniform', activation='sigmoid'))
  11. model.add(Dense(4, init='uniform', activation='sigmoid'))
  12. model.add(Dense(1, init='uniform', activation='sigmoid'))
  13.  
  14. # Compile model
  15. model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
  16.  
  17. # Fit model
  18. history = model.fit(X, Y, validation_split=0.46, nb_epoch=150, batch_size=3)
RAW Paste Data
Top