Skip to content

Check for is_normalized for NumericalTarget is too strict #767

@AVHopp

Description

@AVHopp

Currently, the check for verifying whether or not a target is normalised is too strict as it checks for Interval(0,1) exactly. This causes issues when using Transformations that do not exactly calculate Interval(0,1) but something close to it like Interval(0,0.999999999) like in the following example:

from baybe.targets import NumericalTarget

t_clamp_bug = NumericalTarget.match_bell(name = "Bug", match_value=5, sigma=0.1).clamp(0, 0.606531).normalize()
print(t_clamp_bug.get_image((-100, 100)))
> Interval(lower=0.0, upper=0.9999999999999999)

To fix this, we need to use a tolerance or a fuzzy match when checking whether or not a target is normalised.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions