Skip to content

Commit

Permalink
Merge pull request #6 from samuel920119920119samuel/feature/passing-v…
Browse files Browse the repository at this point in the history
…isdom-arguments

feature: add vis_args for passing visdom arguments
  • Loading branch information
srush authored Sep 10, 2020
2 parents 56b6936 + 3e0610f commit 593c75d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions project/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def make_pts(N):


class Graph:
def __init__(self, vis=False):
def __init__(self, vis=False, vis_args={}):
self.gifs = []
if vis:
self.vis = visdom.Visdom()
self.vis = visdom.Visdom(**vis_args)
else:
self.vis = None
self.first = True
Expand Down Expand Up @@ -74,8 +74,8 @@ def graph(self, outfile, model=None):


class Simple(Graph):
def __init__(self, N, vis=False):
super().__init__(vis)
def __init__(self, N, vis=False, vis_args={}):
super().__init__(vis, vis_args)
self.N = N
self.X = make_pts(N)
self.y = []
Expand All @@ -85,8 +85,8 @@ def __init__(self, N, vis=False):


class Split(Graph):
def __init__(self, N, vis=False):
super().__init__(vis)
def __init__(self, N, vis=False, vis_args={}):
super().__init__(vis, vis_args)
self.N = N
self.X = make_pts(N)
self.y = []
Expand All @@ -96,8 +96,8 @@ def __init__(self, N, vis=False):


class Xor(Graph):
def __init__(self, N, vis=False):
super().__init__(vis)
def __init__(self, N, vis=False, vis_args={}):
super().__init__(vis, vis_args)
self.N = N
self.X = make_pts(N)
self.y = []
Expand Down

0 comments on commit 593c75d

Please sign in to comment.