add optimizer
This commit is contained in:
parent
e24b6eef5a
commit
2443fcf2e3
|
@ -2,6 +2,9 @@ matrix:
|
|||
EPOCHS:
|
||||
- 20
|
||||
- 30
|
||||
OPTIMIZER:
|
||||
- adam
|
||||
- SGD
|
||||
|
||||
steps:
|
||||
"train":
|
||||
|
|
4
run.py
4
run.py
|
@ -9,7 +9,7 @@ from keras import backend as K
|
|||
K.clear_session()
|
||||
|
||||
EPOCHS = int(os.getenv("EPOCHS", default = 10))
|
||||
|
||||
OPTIMIZER = os.getenv("OPTIMIZER", default = "SGD")
|
||||
|
||||
|
||||
gpus = tf.config.experimental.list_physical_devices('GPU')
|
||||
|
@ -72,7 +72,7 @@ with tf.device('/GPU:0'):
|
|||
keras.layers.Dense(10, activation='sigmoid')
|
||||
])
|
||||
# g
|
||||
model.compile(optimizer='SGD',
|
||||
model.compile(optimizer=OPTIMIZER,
|
||||
loss='categorical_crossentropy',
|
||||
metrics=['accuracy'])
|
||||
model.fit(X_train_scaled, y_train_categorical, epochs=EPOCHS)
|
||||
|
|
Loading…
Reference in New Issue