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

SNN_RBM shape mismatch #15

Open
CorpaciLC opened this issue Jan 16, 2022 · 0 comments
Open

SNN_RBM shape mismatch #15

CorpaciLC opened this issue Jan 16, 2022 · 0 comments

Comments

@CorpaciLC
Copy link

Hi,

When running SNN_RBM.py on the datasets from the paper (tried on 1458 and 2261), we get the following error:

'''
../../make-ipinyou-data/2261/train.yzx.txt
drop_mlp4da.py|ad:2261|drop:1|b_size:1000 | X:133465 | Hidden 0:300 | Hidden 1:300 | Hidden 2:100 | L_r:0.0006 | activation1:tanh | lambda:0.0001
Traceback (most recent call last):
File "C:\Users\corpa\anaconda3\lib\site-packages\theano\compile\function_module.py", line 903, in call
self.fn() if output_subset is None else
ValueError: Shape mismatch: x has 37 cols (and 1 rows) but y has 70 rows (and 300 cols)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "SNN_DAE.py", line 85, in
ww0,bb0,ww1,bb1,ww2,bb2=da.get_da_weights(train_file,arr,num_feats=numf,ncases=train_size,batch_size=100000)
File "C:\Users\corpa\Master\Sem3\Experiment Design For Data Science\Assignment2\deep-ctr\python\sampling_based_denosing_autoencoder.py", line 364, in get_da_weights
w,b=sparse_da(num_feats*k,col,file,training_epochs=epochs,sparse_len=row,is_sparse=1,batch_size=1,k=k)
File "C:\Users\corpa\Master\Sem3\Experiment Design For Data Science\Assignment2\deep-ctr\python\sampling_based_denosing_autoencoder.py", line 327, in sparse_da
[cost,z,w,b]=train_da(batcharr,initial_W)
File "C:\Users\corpa\anaconda3\lib\site-packages\theano\compile\function_module.py", line 914, in call
gof.link.raise_with_op(
File "C:\Users\corpa\anaconda3\lib\site-packages\theano\gof\link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "C:\Users\corpa\anaconda3\lib\site-packages\six.py", line 702, in reraise
raise value.with_traceback(tb)
File "C:\Users\corpa\anaconda3\lib\site-packages\theano\compile\function_module.py", line 903, in call
self.fn() if output_subset is None else
ValueError: Shape mismatch: x has 37 cols (and 1 rows) but y has 70 rows (and 300 cols)
Apply node that caused the error: Dot22(Elemwise{Mul}[(0, 0)].0, ww)
Toposort index: 12
Inputs types: [TensorType(float64, matrix), TensorType(float64, matrix)]
Inputs shapes: [(1, 37), (70, 300)]
Inputs strides: [(296, 8), (2400, 8)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[Elemwise{Composite{scalar_sigmoid((i0 + i1))}}[(0, 0)](Dot22.0, InplaceDimShuffle{x,0}.0)]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "SNN_DAE.py", line 85, in
ww0,bb0,ww1,bb1,ww2,bb2=da.get_da_weights(train_file,arr,num_feats=numf,ncases=train_size,batch_size=100000)
File "C:\Users\corpa\Master\Sem3\Experiment Design For Data Science\Assignment2\deep-ctr\python\sampling_based_denosing_autoencoder.py", line 364, in get_da_weights
w,b=sparse_da(num_feats*k,col,file,training_epochs=epochs,sparse_len=row,is_sparse=1,batch_size=1,k=k)
File "C:\Users\corpa\Master\Sem3\Experiment Design For Data Science\Assignment2\deep-ctr\python\sampling_based_denosing_autoencoder.py", line 249, in sparse_da
cost, updates,z,w,b = da.get_cost_updates(
File "C:\Users\corpa\Master\Sem3\Experiment Design For Data Science\Assignment2\deep-ctr\python\sampling_based_denosing_autoencoder.py", line 102, in get_cost_updates
y = self.get_hidden_values(tilde_x)
File "C:\Users\corpa\Master\Sem3\Experiment Design For Data Science\Assignment2\deep-ctr\python\sampling_based_denosing_autoencoder.py", line 92, in get_hidden_values
return T.nnet.sigmoid(T.dot(input, self.W) + self.b)

HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
'''

Ideas of solutions?

Thanks!

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