Work with ML training jobs with Viam's ML training API | APIs

Work with ML training jobs with Viam's ML training API

The ML training API allows you to get information about and cancel ML training jobs running on Viam.

The ML training client API supports the following methods:

Method Name Description
SubmitTrainingJob Submit a training job.
SubmitCustomTrainingJob Submit a training job from a custom training script.
GetTrainingJob Get training job metadata.
ListTrainingJobs Get training job metadata for all jobs within an organization.
CancelTrainingJob Cancel the specified training job.
DeleteCompletedTrainingJob Delete a completed training job from the database, whether the job succeeded or failed.

Establish a connection

To use the ML training client API, you need to instantiate a ViamClient and then instantiate an MLTrainingClient.

You need an API key and API key ID with Org owner permissions to use the MLTraining client API. To get an API key (and corresponding ID), use the web UI to the Viam CLI.


Copy


Copy


Copy

Once you have instantiated an MLTrainingClient, you can run the following API methods against the MLTrainingClient object (named ml_training_client in the examples).

API

SubmitTrainingJob

Submit a training job.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

SubmitCustomTrainingJob

Submit a training job from a custom training script. Follow the guide to Train a Model with a Custom Python Training Script.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

GetTrainingJob

Get training job metadata.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

ListTrainingJobs

Get training job metadata for all jobs within an organization.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

CancelTrainingJob

Cancel the specified training job.

Parameters:

Returns:

Raises:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.

DeleteCompletedTrainingJob

Delete a completed training job from the database, whether the job succeeded or failed.

Parameters:

Returns:

Example:


Copy

For more information, see the Python SDK Docs.

Parameters:

Returns:

For more information, see the Go SDK Docs.

Parameters:

Returns:

Example:


Copy

For more information, see the TypeScript SDK Docs.