SHARE
TWEET

Untitled

a guest Aug 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. optimizer = RMSprop(lr=1e-4)
  2. objective = 'binary_crossentropy'
  3.  
  4.  
  5. def malefemale():
  6.    
  7.     model = Sequential()
  8.  
  9.     model.add(Convolution2D(32, 3, 3, border_mode='same', input_shape=(3, ROWS, COLS), activation='relu'))
  10.     model.add(Convolution2D(32, 3, 3, border_mode='same', activation='relu'))
  11.     model.add(MaxPooling2D(pool_size=(2, 2), dim_ordering="th"))
  12.  
  13.     model.add(Convolution2D(64, 3, 3, border_mode='same', activation='relu'))
  14.     model.add(Convolution2D(64, 3, 3, border_mode='same', activation='relu'))
  15.     model.add(MaxPooling2D(pool_size=(2, 2), dim_ordering="th"))
  16.    
  17.     model.add(Convolution2D(128, 3, 3, border_mode='same', activation='relu'))
  18.     model.add(Convolution2D(128, 3, 3, border_mode='same', activation='relu'))
  19.     model.add(MaxPooling2D(pool_size=(2, 2), dim_ordering="th"))
  20.    
  21.     model.add(Convolution2D(256, 3, 3, border_mode='same', activation='relu'))
  22.     model.add(Convolution2D(256, 3, 3, border_mode='same', activation='relu'))
  23. #     model.add(Convolution2D(256, 3, 3, border_mode='same', activation='relu'))
  24.     model.add(MaxPooling2D(pool_size=(2, 2), dim_ordering="th"))
  25.  
  26.  
  27.  
  28.     model.add(Flatten())
  29.     model.add(Dense(256, activation='relu'))
  30.     model.add(Dropout(0.5))
  31.    
  32.     model.add(Dense(256, activation='relu'))
  33.     model.add(Dropout(0.5))
  34.  
  35.     model.add(Dense(1))
  36.     model.add(Activation('sigmoid'))
  37.  
  38.     model.compile(loss=objective, optimizer=optimizer, metrics=['accuracy'])
  39.     return model
  40.  
  41.  
  42. model = malefemale()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top