Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d71cf9d commit e6dd99cCopy full SHA for e6dd99c
16_tensorboard.py
@@ -113,7 +113,8 @@ def forward(self, x):
113
print (f'Epoch [{epoch+1}/{num_epochs}], Step [{i+1}/{n_total_steps}], Loss: {loss.item():.4f}')
114
############## TENSORBOARD ########################
115
writer.add_scalar('training loss', running_loss / 100, epoch * n_total_steps + i)
116
- writer.add_scalar('accuracy', running_correct / 100, epoch * n_total_steps + i)
+ running_accuracy = running_correct / 100 / predicted.size(0)
117
+ writer.add_scalar('accuracy', running_accuracy, epoch * n_total_steps + i)
118
running_correct = 0
119
running_loss = 0.0
120
###################################################
0 commit comments