pykan icon indicating copy to clipboard operation
pykan copied to clipboard

UnboundLocalError: local variable 'alpha_mask' referenced before assignment

Open HuizhiXu opened this issue 9 months ago • 1 comments

When executing self.model.plot(), an error occurs: UnboundLocalError: local variable 'alpha_mask' referenced before assignment.

Upon inspection of the code, it indicates that when the necessary conditions are not met, the alpha_mask remains undefined.

截屏2024-05-15 14 31 27

HuizhiXu avatar May 15 '24 06:05 HuizhiXu

Hi, what is the value of symbol_mask and numerical_mask in your case?

KindXiaoming avatar May 15 '24 11:05 KindXiaoming

Hi, we have finally reproduced the error. We run 30 steps and call the plot function after each training step. The error occurs during the process: when the training error suddenly becomes NaN, the next step is to plot, and then the error occurs. At this point, both the values of symbol_mask and numerical_mask are NaN.

HuizhiXu avatar May 30 '24 06:05 HuizhiXu

I see, the nan loss seems like the real bug. Please open another issue for the nan loss if you still have the problem.

KindXiaoming avatar Jul 14 '24 04:07 KindXiaoming