andreasveit / conditional-similarity-networks

BSD 3-Clause "New" or "Revised" License
222 stars 52 forks source link

Deprecated APIs #8

Open ahmdtaha opened 6 years ago

ahmdtaha commented 6 years ago

The current code base calls a couple of deprecated functions. I use 1)Python 3.6.5 :: Anaconda, Inc. 2) Pytorch 0.4.1

return (pred > 0.0).sum()1.0/dista.size()[0] should become >>>>>> return (pred > 0.0).sum().float() (1.0/dista.size()[0])

self.viz.updateTrace(X=np.array([x]), Y=np.array([y]), env=print_env, win=self.plots[var_name], name=split_name) should become >>>>>> self.viz.line(X=np.array([x]), Y=np.array([y]), env=print_env, win=self.plots[var_name], name=split_name,update='append')

There are probably more similar issues but these are the ones I can confirm now

DaPenggg commented 5 years ago

amazing!! thx~