LinAlgError: SVD did not converge

LinAlgError: SVD did not converge

Summary

Recently, Python was used to implement a mixed Gaussian distribution to generate training sets and test sets, and an error message SVD did not converge appeared in a part of the code for pseudo-inversion. After more than six hours of debugging, including searching for solutions to SVD did not converge on csdn, the problem is still not solved. Finally, I asked my classmates in the same lab for help and found that the generated samples would cause nan values ​​in some intermediate operations. So, I tried to use a single Gaussian distribution to generate data. Sure enough, the error disappeared and the code ran smoothly. However, errors still occur when inverting data generated using a mixture of Gaussian distributions. Finally, I used matlab to generate mixed Gaussian distribution data (matlab has a ready-made mixed Gaussian distribution library that can be called).

Experience summary

If you encounter problems that are difficult to solve in python programming, you can consider them from the data perspective and observe whether there are nan values ​​in the generated data.

Guess you like

Origin blog.csdn.net/ChenglinBen/article/details/130828124