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.2.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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for kozhindev_clearml_wrapper-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e0150e99a06c14d26dfc1e152a8e4b95cc6430801268f948472b22d1d676cd95
MD5 c8f603cfcbf47faaf2d3e2751be5de00
BLAKE2b-256 03b28f4d793f034bbd677f605e44a37f16344bf466e79d314cf4dcca92c93cdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kozhindev_clearml_wrapper-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee16aa05ec92b6b237da08dfac66af2cdacfc5627d44d7c6d7fed1397f530bf
MD5 c42def215dd497fdaba159042f66d2aa
BLAKE2b-256 6c6bbc6901249656fe9d7c564605a5899734b000e1a33c920ea1be949cb25489

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