Bring-Your-Own-Task (BYOT)
The Bring-Your-Own-Task (BYOT) feature allows users to create custom tasks for training, evaluating, and deploying heart-related AI models. This feature is useful for creating custom workflows for a given application with minimal coding.
For an in-depth guide check out the BYOT Notebook Guide.
How it Works
Section titled “How it Works”-
Create a Task: Define a new task that inherits from the HKTask base class and implements the required methods:
train,evaluate,export, anddemo.Python example import heartkit as hkclass CustomTask(hk.HKTask):@staticmethoddef train(params: hk.HKTrainParams) -> None:pass@staticmethoddef evaluate(params: hk.HKTestParams) -> None:pass@staticmethoddef export(params: hk.HKExportParams) -> None:pass@staticmethoddef demo(params: hk.HKDemoParams) -> None:pass -
Register the Task: Register the new task with the
TaskFactoryby calling theregistermethod. This method takes the task name and the task class as arguments.Python example # Register the custom taskhk.TaskFactory.register("custom", CustomTask) -
Use the Task: The new task can now be used with the
TaskFactoryto perform various operations such as training, evaluating, and deploying models.Python example # Define task parametersparams = hk.HKTrainParams(...)# Get the custom tasktask = hk.TaskFactory.get("custom")# Train the modeltask.train(params)