SHARE
TWEET

Untitled

a guest Nov 14th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. inputs = Input(shape=(19860,))
  2.  
  3. x = Dense(64,activation='relu')(inputs)
  4. x = Dropout(0.5)(x)
  5. x = Dense(64,activation='sigmoid')(x)
  6. x = Dropout(0.5)(x)
  7. preds = Dense(20,activation='softmax')(x)
  8.  
  9. model = Model(inputs=inputs,outputs=preds)
  10. model.compile(loss='categorical_crossentropy',
  11.              optimizer='adam',
  12.              metrics=['acc'])
  13. model.fit(X_train,Y_train, validation_data=(X_val, Y_val),
  14.      epochs=10, batch_size=32)
  15.    
  16. inputs = Input(shape=(19860,))
  17.  
  18. x = Dense(64,activation='relu')(inputs)
  19. x = Dropout(0.5)(x)
  20. x = Dense(64,activation='sigmoid')(x)
  21. x = Dropout(0.5)(x)
  22. preds = Dense(20,activation='sigmoid')(x)
  23.  
  24. model = Model(inputs=inputs,outputs=preds)
  25. model.compile(loss='binary_crossentropy',
  26.              optimizer='adam',
  27.              metrics=['acc'])
  28. model.fit(X_train,Y_train, validation_data=(X_val, Y_val),
  29.      epochs=10, batch_size=32)
  30.    
  31. from keras.metrics import categorical_accuracy
  32. model.compile(loss='binary_crossentropy', optimizer='adam', metrics=[categorical_accuracy])
RAW Paste Data
Top