(x_batch, y_batch)
| 39 | # training function |
| 40 | @tf.function |
| 41 | def train_step(x_batch, y_batch): |
| 42 | # forward + backward |
| 43 | with tf.GradientTape() as tape: |
| 44 | ## compute outputs |
| 45 | _logits = vgg(x_batch) |
| 46 | ## compute loss and update model |
| 47 | _loss = loss_object(_logits, y_batch) |
| 48 | |
| 49 | grad = tape.gradient(_loss, train_weights) |
| 50 | optimizer.apply_gradients(zip(grad, train_weights)) |
| 51 | |
| 52 | |
| 53 | # begin training |
no test coverage detected
searching dependent graphs…