Skip to main content

Wrapper over clearml, developed by ML team of KozhinDev company

Project description

KozhinDev ClearML Wrapper

A set of utility functions and decorators for simplifying ClearML integration in your ML projects

Features

  • log_metrics – decorator for logging scalar metrics
  • get_local_dataset_path – get local path to a dataset file/folder
  • prepare_task – initialize or retrieve ClearML tasks (local or remote)
  • get_local_model_path – retrieve a local copy of a model artifact

First, install the library: pip install kozhindev_clearml_wrapper

Usage

  1. Logging metrics
    Use the @log_metrics decorator to log scalar metrics to ClearML:
from clearml import Task
from kozhindev_clearml_wrapper import log_metrics

task = Task.init(project_name="Demo", task_name="Log Metrics Example")

@log_metrics(task)
def train():
    for i in range(5):
        yield "loss", "train", 0.1 * i, i  # (title, series, metric, iteration)

train()
  1. Get Local Dataset Path
    Retrieve a dataset by ID and get the local path to a file or folder inside it:
from kozhindev_clearml_wrapper import get_local_dataset_path

dataset_path = get_local_dataset_path(
    dataset_id="your-dataset-id",
    dataset_name="data.csv"
)

print(dataset_path)
  1. Prepare ClearML Task
    Initialize a new task (local) or connect to an existing one (remote):
from kozhindev_clearml_wrapper import prepare_task

# Local task (creates a new one)
task = prepare_task(
    task_type="local",
    project_name="Demo",
    task_name="Local Task Example"
)

# Remote task (connects training parameters to the current ClearML task)
train_params = {"learning_rate": 0.001, "epochs": 10}
task = prepare_task(
    task_type="remote",
    train_params=train_params
)
  1. Get Local Model Path
    Download and get the local path to a model artifact from a specific task:
from kozhindev_clearml_wrapper import get_local_model_path

path_to_model = get_local_model_path(
    task_id="your-task-id",
    artifact_name="trained_models"
)

print(path_to_model)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kozhindev_clearml_wrapper-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kozhindev_clearml_wrapper-0.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file kozhindev_clearml_wrapper-0.0.1.tar.gz.

File metadata

File hashes

Hashes for kozhindev_clearml_wrapper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0c321cdb95b01183948f8e0709e293e36baf16b5b041e461add5c55b6644f439
MD5 60162ee1a0a02c287c903f5604be88c8
BLAKE2b-256 cc4feabb092f07c9dd9e93246f465f3700a6253a7f657775cf420c5a4a9346c6

See more details on using hashes here.

File details

Details for the file kozhindev_clearml_wrapper-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kozhindev_clearml_wrapper-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8afe825eb14f5dd6393df194c34527468d265455ccd201977e854a9230e8d232
MD5 d93d4259283973b4d7f06a824cad4038
BLAKE2b-256 612daacd672759a488d9f5112de643a10f68182d915c275c175ff00e66691913

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page