Guest User

Untitled

a guest
May 17th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. class_weights = {0: 1.4, 1: 1, 2: 2.3, 3: 2.3}
  2.  
  3. # sets up the model shape
  4. model = Sequential()
  5. model.add(Conv2D(32, (3, 3), activation='relu', input_shape=input_shape))
  6. model.add(MaxPooling2D(pool_size=(2, 2)))
  7.  
  8. model.add(Conv2D(64, (3, 3), activation='relu'))
  9. model.add(MaxPooling2D(pool_size=(2, 2)))
  10.  
  11. model.add(Flatten())
  12. model.add(Dense(64, activation='relu'))
  13. model.add(Dropout(0.05))
  14.  
  15. model.add(Dense(64, activation='relu'))
  16. model.add(Dropout(0.05))
  17.  
  18. model.add(Dense(n_classes, activation='softmax'))
  19.  
  20. model.compile(loss='categorical_crossentropy',
  21. optimizer='Adam',
  22. metrics=['accuracy'])
  23.  
  24. # sets up the call back so we can have the logs
  25. tbCallBack = TensorBoard(log_dir=log_pth.format(time()))
Add Comment
Please, Sign In to add comment