Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

w and V variables reversed from paper in Tensorflow implementation? #5

Open
gmeehan96 opened this issue Jun 5, 2019 · 1 comment
Open

Comments

@gmeehan96
Copy link

Hi - really like the OC-NN idea and looking forward to trying it myself. Just one thing I've noticed which, although I don't think it will affect how the code runs, caused me quite a bit of confusion when reviewing the tensorflow implementation of the OC-NN here (https://github.com/raghavchalapathy/oc-nn/blob/master/models/tf_OneClass_NN_model.py). The variable names for w and V in the nnScore function(s) seem to be swapped from their role in the paper. For example, in line 109, the score is defined as tf.matmul(g((tf.matmul(X, w))), V), where X is being multiplied by w, whereas in equation 3 in your paper it is the weight matrix V which is multiplying X. I'm pretty sure though that when you initialise these weights later on in lines 285-6 (with w1 as w and w2 as V), you then have them as the correct dimensions, so that w is playing the role of V and V becomes the vector w.

If I'm right, I thought this was worth flagging as it has the potential to confuse people trying to understand the code; if I'm wrong I apologise, and wouldn't mind some help in explaining what was going on!

Thanks again!

@raghavchalapathy
Copy link
Owner

raghavchalapathy commented Jun 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants