Commit cf912d5
authored
Fix: EarlyStopping callback initialisation in CAREamist (#774)
## Description
> [!NOTE]
> **tldr**: Fixes a bug in CAREamist initialisation of the
`EarlyStopping` callback.
### Background - why do we need this PR?
Instead of dumping the parameters from the `EarlyStoppingConfig`
pydantic model, it was passed as the first argument and this was
interpreted as the value the callback was meant to monitor, later
leading to an error.
### Overview - what changed?
Fixed the callback initialisation and added a test.
## Changes Made
<!-- This section highlights the important features and files that
reviewers should
pay attention to when reviewing. Only list important features or files,
this is useful for
reviewers to correctly assess how deeply the modifications impact the
code base.
## How has this been tested?
Added a test which runs training with CAREamist and has both the
`EarlyStopping` and `Checkpoint` callback configuration.
## Related Issues
<!-- Link to any related issues or discussions. Use keywords like
"Fixes", "Resolves",
or "Closes" to link to issues automatically. -->
- Resolves #770
---
**Please ensure your PR meets the following requirements:**
- [x] Code builds and passes tests locally, including doctests
- [x] New tests have been added (for bug fixes/features)
- [x] Pre-commit passes
- [ ] PR to the documentation exists (for bug fixes / features)1 parent 49f0b0f commit cf912d5
2 files changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
389 | 419 | | |
390 | 420 | | |
391 | 421 | | |
| |||
1136 | 1166 | | |
1137 | 1167 | | |
1138 | 1168 | | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
| 1169 | + | |
1145 | 1170 | | |
1146 | 1171 | | |
1147 | 1172 | | |
| |||
0 commit comments