mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
update_loss_printing
This commit is contained in:
@@ -135,9 +135,8 @@ model = tf.keras.Model(inputs=tokens, outputs=logits)
|
||||
def loss(labels, logits):
|
||||
loss = tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True)
|
||||
sum = tf.math.reduce_sum(loss)
|
||||
print_op = tf.Print(sum, [sum])
|
||||
with tf.control_dependencies([print_op]):
|
||||
return loss
|
||||
loss = tf.Print(loss, [sum])
|
||||
return loss
|
||||
|
||||
|
||||
# the optimizer is not used since this code only supports inference
|
||||
|
||||
Reference in New Issue
Block a user