Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 7bb3e56

Browse files
committed
Drop additional logging for ResNet-CIFAR10
1 parent 79fc50d commit 7bb3e56

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Examples/ResNet-CIFAR10/main.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Datasets
1616
import ImageClassificationModels
1717
import TensorFlow
1818

19-
let batchSize = 512
19+
let batchSize = 10
2020

2121
let dataset = CIFAR10(batchSize: batchSize)
2222

@@ -34,7 +34,6 @@ for (epoch, epochBatches) in dataset.training.prefix(10).enumerated() {
3434
Context.local.learningPhase = .training
3535
var trainingLossSum: Float = 0
3636
var trainingBatchCount = 0
37-
let batchCount = epochBatches.count
3837
for batch in epochBatches {
3938
let (images, labels) = (batch.data, batch.label)
4039
let (loss, gradients) = valueWithGradient(at: model) { model -> Tensor<Float> in
@@ -44,7 +43,6 @@ for (epoch, epochBatches) in dataset.training.prefix(10).enumerated() {
4443
trainingLossSum += loss.scalarized()
4544
trainingBatchCount += 1
4645
optimizer.update(&model, along: gradients)
47-
print(trainingLossSum / Float(trainingBatchCount), Float(trainingBatchCount) / Float(batchCount))
4846
}
4947

5048
Context.local.learningPhase = .inference

0 commit comments

Comments
 (0)