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

calculation error when inverting a matrix #82

Open
ShuangtongLi opened this issue May 20, 2019 · 0 comments
Open

calculation error when inverting a matrix #82

ShuangtongLi opened this issue May 20, 2019 · 0 comments

Comments

@ShuangtongLi
Copy link

Hi,
I am really interested in your model.I notice that your model requires every layer to be invertible.However,I did a simple test on calculation error when inverting a matrix.It can be viewd as a fully connected network.The result seems unacceptable(all elements in (a-copya) is between 10-100).My simple test code is as below.

import numpy as np
sizeb=1000
a=np.random.rand(1,sizeb)
copya=a
num=5
for i in range(num):
exec('weight'+str(i)+'=np.mat(np.random.rand(sizeb,sizeb))')
for i in range(num):
exec('a=np.dot(a,weight'+str(i)+')')
for i in range(num):
exec('a=np.dot(a,weight'+str(num-i-1)+'.I)')
print(a-copya)

I wonder why your model is able to be invertible,since even a shallow fully connected network get a large calculation error when inverting.I would really appreciate it if you could tell me why it is the case.Thanks a lot!

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

1 participant