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 metricsget_local_dataset_path– get local path to a dataset file/folderprepare_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
- 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()
- 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)
- 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
)
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kozhindev_clearml_wrapper-0.0.2.tar.gz.
File metadata
- Download URL: kozhindev_clearml_wrapper-0.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0150e99a06c14d26dfc1e152a8e4b95cc6430801268f948472b22d1d676cd95
|
|
| MD5 |
c8f603cfcbf47faaf2d3e2751be5de00
|
|
| BLAKE2b-256 |
03b28f4d793f034bbd677f605e44a37f16344bf466e79d314cf4dcca92c93cdf
|
File details
Details for the file kozhindev_clearml_wrapper-0.0.2-py3-none-any.whl.
File metadata
- Download URL: kozhindev_clearml_wrapper-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ee16aa05ec92b6b237da08dfac66af2cdacfc5627d44d7c6d7fed1397f530bf
|
|
| MD5 |
c42def215dd497fdaba159042f66d2aa
|
|
| BLAKE2b-256 |
6c6bbc6901249656fe9d7c564605a5899734b000e1a33c920ea1be949cb25489
|