insung3511 / ecg-dbn

ECG Classification of Normal and Abnormal with GB-DBN Model (pytorch)
MIT License
0 stars 0 forks source link

(v_data).scatter_(1, index_tensor, v_data.clone())) #1

Closed insung3511 closed 2 years ago

insung3511 commented 2 years ago

I'm stuck in problem on RBM.py line 78. That part is multiply of matrix, tensors that for positive way. But I think this issue is a data type problem. Code of issue part is this.

        stats_pos = torch.matmul(h_prob_pos,
                                (v_data).scatter_(1, index_tensor, v_data.clone()))

and error is...

Traceback (most recent call last):
  File "/Users/bahk_insung/Documents/Github/ecg-dbn/model.py", line 41, in <module>
    error = bbrbm.cd(train_temp_data)
  File "/Users/bahk_insung/Documents/Github/ecg-dbn/BBRBM.py", line 27, in cd
    return RBMBase.cd(self, v_data, k, eta, alpha, lam)
  File "/Users/bahk_insung/Documents/Github/ecg-dbn/RBM.py", line 78, in cd
    (v_data).scatter_(1, index_tensor, v_data.clone()))
RuntimeError: index 1 is out of bounds for dimension 1 with size 1

Still workin solve and anyone know about this problem, please comment on my issue. Thank you :D

insung3511 commented 2 years ago

Get back to same previous problem. You can see that I committed message I always stuck in this error.

RuntimeError: inconsistent tensor size, expected tensor [80] and src [180] to have the same number of elements, but got 80 and 180 elements respectively

I matched dimension and matrix multiply problem are solved but I think data type issue.

insung3511 commented 2 years ago

Aight, I solved the stats_pos matmul part. But same problem at stats_neg 😂😂😂 WIP now, and I will commenting for my status.

insung3511 commented 2 years ago

All solved problem with stats_pos and stats_neg. Each of stats positive and negative was same input parameter types and size were unmatched.

If you want more specific describe send email or contact to me.