gregversteeg / bio_corex

A flexible version of CorEx developed for bio-data challenges that handles missing data, continuous/discrete variables, multi-CPU, overlapping structure, and includes visualizations
Apache License 2.0
139 stars 29 forks source link

Error in corex.py #5

Closed paramdutta closed 6 years ago

paramdutta commented 6 years ago

Hi, Thanks for your work and making this openly available. I tried to run python vis_corex.py data/test_data.csv

I get the following error. Can you let me know if I am missing something ?

Thanks, Param

Traceback (most recent call last): File "vis_corex.py", line 765, in n_cpu=options.cpu, ram=options.ram).fit(X)] File "/Users/paramadutta/xAI/repos/bio_corex/corex.py", line 171, in fit self.fit_transform(X) File "/Users/paramadutta/xAI/repos/bio_corex/corex.py", line 207, in fit_transform self.p_y_given_x, self.log_z = self.calculate_latent(self.theta, Xm) File "/Users/paramadutta/xAI/repos/bio_corex/corex.py", line 336, in calculate_latent log_p_y_given_x_unnorm[:, l:l+batch_size, :] = self.log_p_y + np.einsum('ikl,ijkl->ijl', self.alpha, log_marg_x) File "/Library/Python/2.7/site-packages/numpy/core/einsumfunc.py", line 1087, in einsum einsum_call=True) File "/Library/Python/2.7/site-packages/numpy/core/einsumfunc.py", line 710, in einsum_path "not match previous terms.", char, tnum) ValueError: ("Size of label '%s' for operand %d does not match previous terms.", 'l', 1)

gregversteeg commented 6 years ago

I introduced a fix. Can someone with the affected version of numpy confirm that it works?