You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes a quotient above can be zero (for example if in input we have quadruplets that have the two last points identical)
I'm not sure that this case would happen in a real-life case (like if the data is clean, there is no duplicates etc...) I need to think more about it
/home/will/Code/metric-learn/metric_learn/lsml.py:130: RuntimeWarning: divide by zero encountered in double_scalars
(1-np.sqrt(dab/dcd))*np.outer(vcd, vcd))
/home/will/Code/metric-learn/metric_learn/lsml.py:130: RuntimeWarning: invalid value encountered in multiply
(1-np.sqrt(dab/dcd))*np.outer(vcd, vcd))
Traceback (most recent call last):
File "/home/will/.PyCharmCE2018.3/config/scratches/scratch_51.py", line 7, in <module>
lsml.fit(quadruplets)
File "/home/will/Code/metric-learn/metric_learn/lsml.py", line 167, in fitreturnself._fit(quadruplets, weights=weights)
File "/home/will/Code/metric-learn/metric_learn/lsml.py", line 79, in _fit
grad_norm = scipy.linalg.norm(grad)
File "/home/will/anaconda3/envs/standard/lib/python3.7/site-packages/scipy/linalg/misc.py", line 137, in norm
a = np.asarray_chkfinite(a)
File "/home/will/anaconda3/envs/standard/lib/python3.7/site-packages/numpy/lib/function_base.py", line 461, in asarray_chkfinite"array must not contain infs or NaNs")
ValueError: array must not contain infs or NaNs
Description
LSML returns an error in some particular cases. We should decide what to do in those cases, either let it as such, or return a particular error. This error occurs at these lines :
https://github.com/metric-learn/metric-learn/blob/bf5c7224cc7ad4c025e15b247a80e076b7f75062/metric_learn/lsml.py#L129-L130
Sometimes a quotient above can be zero (for example if in input we have quadruplets that have the two last points identical)
I'm not sure that this case would happen in a real-life case (like if the data is clean, there is no duplicates etc...) I need to think more about it
Steps/Code to Reproduce
Example:
Expected Results
To be defined
Actual Results
Versions
The text was updated successfully, but these errors were encountered: