MCPcopy Create free account
hub / github.com/tensorflow/models / update_loss

Function update_loss

official/projects/triviaqa/train.py:239–242  ·  view source on GitHub ↗
(y, logits)

Source from the content-addressed store, hash-verified

237
238 @tf.function
239 def update_loss(y, logits):
240 loss_fn = modeling.SpanOrCrossEntropyLoss(
241 reduction=tf_keras.losses.Reduction.NONE)
242 return loss_metric(loss_fn(y, logits))
243
244 predictions = collections.defaultdict(list)
245 for _, (features, labels) in validation_dataset.enumerate():

Callers 1

evaluateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected