jity16 / ACE-Off-Policy-Actor-Critic-with-Causality-Aware-Entropy-Regularization

Official PyTorch implementation of "ACE:Off-Policy Actor-Critic with Causality-Aware Entropy Regularization"
20 stars 0 forks source link

Error computing in lingam #2

Closed HYeCao closed 4 months ago

HYeCao commented 4 months ago

Great work, and thank you for sharing the code. We encountered some errors while running the code with the default settings. Are these errors reasonable, and will they affect the calculation of causality?

home/chy/code/causalRL/ace/causallearnmain/causallearn/search/FCMBased/lingam/direct_lingam.py:150: RuntimeWarning: divide by zero encountered in divide return (self._entropy(xj_std) + self._entropy(ri_j / np.std(ri_j))) - \ /home/chy/anaconda3/envs/ace/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:2306: RuntimeWarning: divide by zero encountered in log n_samples np.log(2 np.pi * self.noisevariance)
/home/chy/anaconda3/envs/ace/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:2307: RuntimeWarning: invalid value encountered in divide

image

YanaZeng commented 4 months ago

Hi, HYeCao. Thanks so much for your interest in our work.

These error messages you encountered likely indicate that the noise variance is too small, approaching zero. This issue generally would not impact the overall calculations much. However, to avoid such problems, you could try setting a minimum threshold for the noise variance, such as 1e-8. This will help prevent division by zero errors.