File size: 406 Bytes
1633fcc
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from torch.utils.tensorboard import SummaryWriter
import numpy as np
np.random.seed(20200910)
writer = SummaryWriter()
for n_iter in range(100):
    writer.add_scalar('Loss/train', np.random.random(), n_iter)
    writer.add_scalar('Loss/test', np.random.random(), n_iter)
    writer.add_scalar('Accuracy/train', np.random.random(), n_iter)
    writer.add_scalar('Accuracy/test', np.random.random(), n_iter)