| 84 | * per second. |
| 85 | */ |
| 86 | export function onTrainBatchEnd(logs, progress, examplesPerSec) { |
| 87 | logStatus( |
| 88 | `Model training: ${(progress * 1e2).toFixed(1)}% complete... ` + |
| 89 | `(${examplesPerSec.toFixed(0)} examples/s)`); |
| 90 | batchLossValues.push(logs); |
| 91 | const container = document.getElementById('batch-loss-canvas'); |
| 92 | tfvis.show.history(container, batchLossValues, ['loss'], { |
| 93 | height: 300, |
| 94 | zoomToFit: true, |
| 95 | xLabel: 'Batch', |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | export function onTrainEpochEnd(logs) { |
| 100 | epochLossValues.push(logs); |