aimclub / aimclub/GOLEM

Setting `early_stopping_timeout` to `None` is not handled correctly

Open
#290 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
73
Forks
11
Avg merge
8h 51m
Merged PRs (30d)
4

Description

While working with FEDOT, I discovered that the `early_stopping_timeout` parameter cannot be set to `None`. Attempting to do so results in the following errors:

```
> lambda: self.generations.stagnation_time_duration >= max_stagnation_time,
'Optimisation finished: Early stopping timeout criteria was satisfied'
)
E TypeError: '>=' not supported between instances of 'float' and 'datetime.timedelta'

../../golem/core/optimisers/populational_optimizer.py:75: TypeError
```
when `timeout` parameter is set and

```
> lambda: self.generations.stagnation_time_duration >= max_stagnation_time,
'Optimisation finished: Early stopping timeout criteria was satisfied'
)
E TypeError: '>=' not supported between instances of 'float' and 'NoneType'

../../golem/core/optimisers/populational_optimizer.py:75: TypeError
```
when both `early_stopping_timeout` and `timeout` parameters are `None`

## Current Workaround:
Currently, to disable this parameter, one can use `early_stopping_timeout=np.inf` instead.

## Expected Behavior:

Setting `early_stopping_timeout=None` should:

- Be accepted as a valid parameter value
- Effectively disable the early stopping timeout functionality

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.