Bring-Your-Own-Task (BYOT)
The Bring-Your-Own-Task (BYOT) feature allows users to create custom tasks for training, evaluating, and deploying sleep-related AI models. This feature is useful for creating custom workflows for a given application with minimal coding.
How it Works
Section titled “How it Works”-
Create a Task: Define a new task by creating a new Python file. The file should contain a class that inherits from the
sk.Taskbase class and implements the required methods.Python example import sleepkit as skclass CustomTask(sk.Task):@staticmethoddef train(params: sk.TaskParams) -> None:pass@staticmethoddef evaluate(params: sk.TaskParams) -> None:pass@staticmethoddef export(params: sk.TaskParams) -> None:pass@staticmethoddef demo(params: sk.TaskParams) -> None:pass -
Register the Task: Register the new task with the
sk.TaskFactoryby calling theregistermethod. This method takes the task name and the task class as arguments.Python example ...sk.TaskFactory.register("custom", CustomTask) -
Use the Task: The new task can now be used with the
sk.TaskFactoryto perform various operations such as training, evaluating, and deploying models.Python example ...params = sk.TaskParams(...)task = sk.TaskFactory.get("custom")task.train(params)