Canvas#
lit.sdk.model.canvas
#
This module provides functionality for managing model canvases in the LIT platform. A model canvas is a no-code representation of a machine learning model, allowing users to define, modify, and manage model configurations.
Canvas
#
Represents a model canvas, the no-code representation of a machine learning model.
inputs
property
#
name = name
instance-attribute
#
The name of the canvas.
outputs
property
#
Retrieves the names of the outputs from the canvas.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list input names. |
Examples:
path
instance-attribute
#
The path to the JSON representation of the canvas on disk.
team = team
instance-attribute
#
The name of a team.
__init__(team, name=None, path=None)
#
Initializes a new instance of Canvas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The team which owns the Canvas. |
required |
name
|
str
|
The name of the Canvas. |
None
|
duplicate()
#
Duplicates a canvas.
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while duplicating the canvas. |
Returns:
| Type | Description |
|---|---|
Canvas
|
The duplicated canvas. |
get_available_components()
#
List available components that can be added to a design canvas.
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while listing the available components. |
Returns:
| Type | Description |
|---|---|
list
|
a list of components. |
Examples:
remove()
#
Removes a canvas permanently.
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while deleting the canvas. |
train(device, session_name=None, temp_canvas=False)
#
Starts a new experiment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
str
|
The name of a device; e.g. gpu4 |
required |
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while starting the experiment. |
Returns:
| Name | Type | Description |
|---|---|---|
session_name |
str
|
The name of the screen session running the experiment. |
transpile()
#
Compiles a design canvas.
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while [ACTION]. |
Returns:
| Type | Description |
|---|---|
Functional
|
A Tensorflow Keras model. |
Examples:
Compile the canvas named 'demo' for the team named 'contoso' to a Tensorflow Keras model.
create_canvas(team, project, asset, features)
#
Create a new design canvas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The name of the team. |
required |
project
|
str
|
The name of the project. |
required |
asset
|
str
|
Name of production asset. |
required |
features
|
list[str]
|
List of features. |
required |
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while [ACTION]. |
Returns:
| Name | Type | Description |
|---|---|---|
Canvas |
Canvas
|
Canvas object |
Examples:
get_canvases(team)
#
Get the saved design canvases for a given team.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The name of the team. |
required |
Raises:
| Type | Description |
|---|---|
LitModelError
|
If an error occurred while [ACTION]. |
Returns:
| Type | Description |
|---|---|
list[Canvas]
|
A list of canvas objects. |
Examples:
Get the path of the first saved definition file for team 'contoso'.