(logs: Logs, prefix: string, step: number)
| 275 | } |
| 276 | |
| 277 | private logMetrics(logs: Logs, prefix: string, step: number) { |
| 278 | for (const key in logs) { |
| 279 | if (key === 'batch' || key === 'size' || key === 'num_steps') { |
| 280 | continue; |
| 281 | } |
| 282 | |
| 283 | const VAL_PREFIX = 'val_'; |
| 284 | if (key.startsWith(VAL_PREFIX)) { |
| 285 | this.ensureValWriterCreated(); |
| 286 | const scalarName = prefix + key.slice(VAL_PREFIX.length); |
| 287 | this.valWriter.scalar(scalarName, logs[key], step); |
| 288 | } else { |
| 289 | this.ensureTrainWriterCreated(); |
| 290 | this.trainWriter.scalar(`${prefix}${key}`, logs[key], step); |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | private logWeights(step: number) { |
| 296 | for (const weights of this.model.weights) { |
no test coverage detected