From ed12b18d37300ffec163f23c64cad2dabda39f5f Mon Sep 17 00:00:00 2001 From: Georgios Albanis Date: Thu, 24 Oct 2024 12:30:30 +0300 Subject: [PATCH] feat: add callback support to objectives --- moai/engine/callbacks/model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/moai/engine/callbacks/model.py b/moai/engine/callbacks/model.py index afd96d0..7e2c008 100644 --- a/moai/engine/callbacks/model.py +++ b/moai/engine/callbacks/model.py @@ -25,3 +25,8 @@ def __init__( # get functions from operations if isinstance(oper.func, Callback): self.data.append(oper.func) + if hasattr(model, "named_objectives"): + for stage in model.named_objectives.values(): + for obj in stage.values(): + if isinstance(obj, Callback): + self.data.append(obj)