Skip to content

Commit

Permalink
feat: add callback support to objectives
Browse files Browse the repository at this point in the history
  • Loading branch information
tzole1155 committed Oct 24, 2024
1 parent 37e82e8 commit ed12b18
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions moai/engine/callbacks/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit ed12b18

Please sign in to comment.