Skip to content

Bug in ApproxEqual used while testing #3949

@akshaysubr

Description

@akshaysubr

The ApproxEqual(float a, float b, float relative_tolerance = 0.001) function used in testing, especially in cudamatrix/cu-math-test doesn't handle the case when a or b are exactly 0. In such a case, the test will always fail even with machine epsilon level round off error:

predicted_objf_change= [ 0 0 0 0 0 ], measured_objf_change= [ -9.53674e-07 0 0 0 0 ]

Some way of regularizing this close to 0 would have less false negatives maybe? This scikit-learn PR has some good suggestions: scikit-learn/scikit-learn#15007

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions