(model, inputs, targets, training)
| 153 | |
| 154 | |
| 155 | def loss_fn(model, inputs, targets, training): |
| 156 | labels = tf.reshape(targets, [-1]) |
| 157 | outputs = model(inputs, training=training) |
| 158 | return tf.reduce_mean( |
| 159 | tf.nn.sparse_softmax_cross_entropy_with_logits( |
| 160 | labels=labels, logits=outputs)) |
| 161 | |
| 162 | |
| 163 | def _divide_into_batches(data, batch_size): |
no test coverage detected