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