forked from dipjyoti92/StarGAN-Voice-Conversion-2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
logger.py
24 lines (18 loc) · 802 Bytes
/
logger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# import tensorflow as tf
from tensorboardX import SummaryWriter
# class Logger(object):
# """Tensorflow Tensorboard logger."""
# def __init__(self, log_dir):
# """Initialize summary writer."""
# self.writer = tf.summary.FileWriter(log_dir)
# def scalar_summary(self, tag, value, step):
# """Add scalar summary."""
# summary = tf.Summary(value=[tf.Summary.Value(tag=tag, simple_value=value)])
# self.writer.add_summary(summary, step)
class Logger(object):
"""Using tensorboardX such that need no dependency on tensorflow."""
def __init__(self, log_dir):
"""Initialize summary writer."""
self.writer = SummaryWriter(log_dir)
def scalar_summary(self, tag, value, step):
self.writer.add_scalar(tag, value, step)