crested.tl.default_configs

crested.tl.default_configs#

crested.tl.default_configs(task, num_classes=None)#

Get default loss, optimizer, and metrics for an existing task.

Possible tasks are: - “topic_classification” - “peak_regression_mean” (w/ alias “peak_regression”) - “peak_regression_count”

The two peak regression configs differ in the multiplier of their CosineMSELogLoss, which must match how the targets were imported with import_bigwigs():

  • “peak_regression_mean” uses multiplier=1000 -> pair with target='mean' (dense coverage; assumes target_region_width=1000).

  • “peak_regression_count” uses multiplier=1 -> pair with target='count' (summed cut sites).

If what you want to do is not supported, you can create your own by using the TaskConfig class.

Example

>>> configs = default_configs("topic_classification")
>>> optimizer, loss, metrics = configs.optimizer, configs.loss, configs.metrics
>>> trainer = Crested(data, model, config=configs, project_name="test")
Parameters:
  • tasks – Task for which to get default components.

  • num_classes (int | None (default: None)) – Number of output classes of model. Required for Spearman correlation metric.

Return type:

TaskConfig

Returns:

Optimizer, loss, and metrics for the given task.