深度学习2.0-21.Keras高层API-compile&fit&Evaluate&Predict
程序员文章站
2022-07-13 13:14:55
...
1.标准的训练
1.loss and optimizer and metrics
before
now
2.epoch and step
before
now
3.evaluation
before
now
network.compile(optimizer = optimizers.Adam(lr=0.01),
loss = tf.losses.CategoricalCrossentropy(from_logits = True),
metrics = ['accuracy']
)
network.fit(db,epochs=10, validation_data = ds_val,
validstion_freq=2)
4.test
evaluate相当于中间的test或者validation