Skip to content

Commit 76b4898

Browse files
authored
Update thyroid_train.py
1 parent c2679a0 commit 76b4898

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

thyroid/thyroid_train.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,14 @@ def get_compiled_model():
9595
adam = Adam(lr=args.lr)
9696
model.compile(optimizer=adam, loss=BinaryCrossentropy(), metrics=[keras.metrics.AUC(name='auc')])
9797
return model
98-
99-
### Open a strategy scope.
100-
with strategy.scope():
101-
# Everything that creates variables should be under the strategy scope.
102-
# In general this is only model construction & `compile()`.
103-
model = get_compiled_model()
104-
105-
106-
10798

10899
def run_model():
109100
### Set train steps and validation steps
101+
### Open a strategy scope.
102+
with strategy.scope():
103+
# Everything that creates variables should be under the strategy scope.
104+
# In general this is only model construction & `compile()`.
105+
model = get_compiled_model()
110106
train_steps = len(train_generator.labels)/ batch_size
111107
val_steps = len(validation_generator.labels) / batch_size
112108

0 commit comments

Comments
 (0)