A loss plotter for multiple losses visualized in Visdom, draw different losses within the same window.
class loss_plotter():
def __init__(self, port = 8097, server = "http://localhost"):
self.vis = visdom.Visdom(port=port, server=server)
assert self.vis.check_connection(timeout_seconds=3),'No connection could be formed quickly'
self.losses = {}
self.win = None