svm-model
will be created under the ml_repo iris-demo
.
You can view these runs in the TrueFoundry dashboard.

TrueFoundry Dashboard
Create and end a run
Create and end a run
Python
Add tags to a run
Add tags to a run
Log parameters
Log parameters
Parameters are used to store the configuration of a run. This can be either the inputs to your script or the hyperparameters of your model during training like 

learning_rate
, cache_size
.
The parameter values are stringified before storing.You can log parameters using the log_params
as shown below:Parameters are immutable and you cannot change the value of param once logged. If you need to change the value of param, it basically means that you are changing your input configuration and it’s best to create a new run for that.
Viewing logged parameter in dashboard

Filtering runs bases on parameter value
To filters runs, click on top right corner of the screen to apply the required filter.
Capturing command-line arguments
We can capture command-line arguments directly from theargparse.Namespace
object.Log metrics
Log metrics
Metrics are values that help you to evaluate and compare different runs - for e.g. These metrics can be seen in Truefoundry dashboard. Filters can be used on metrics values to filter out runs as shown in the figure.

The stepwise-metrics can be visualized as graphs in the dashboard.
Should I use epoch or global step as a value for the
If available you should use the global step as a value for the
accuracy
, f1 score
. You can log any output of your script as a metric.You can capture metrics using the log_metrics
method.
Metrics Overview

Filter runs on the basis of metrics
Step-wise metric logging
You can capture step-wise metrics too using thestep
argument.
Step-wise metrics
Should I use epoch or global step as a value for the step
argument?
If available you should use the global step as a value for the step
argument. To capture epoch-level metric aggregates, you can use the following pattern.Log Artifacts
Log Artifacts
Log Models
Log Models
Log Images
Log Images
You can also log images in different steps in a run. Images can be associated with a step number, in case you are running multiple epochs in training and want to log the images at different steps.Here is the sample code to log images from different sources:Images are represented and logged using this class in TrueFoundry.You can initialize The logged images can be visualized in the TrueFoundry dashboard.
You can also log images with multi-label classification problems.
PIL
package is needed to log images. To install the PIL package, runtruefoundry.ml.Image
by either by using a local path or you can use a numpy array / PIL.Image object.You can also log caption and the actual and predicted values for an image as shown in the examples below.Logging images with caption and a class label

Log Plots
Log Plots
You can also log plots in a run and visualize them in the TrueFoundry Dashboard. You can associate a plot with a step number, in case you are running multiple epochs in training and want to log the plots at different steps.You can log custom matplotlib, plotly plots as shown in examples below:You can visualize the logged plots in the TrueFoundry Dashboard.



Accessing Runs in TrueFoundry
To interact with runs in TrueFoundry, you can use the provided methods in the TrueFoundryClient class. Here are the different possibilities to access runs:Get a Run by ID
Get a Run by ID
To retrieve an existing run by its ID, use the
get_run_by_id
method:Get a Run by Fully Qualified Name (FQN)
Get a Run by Fully Qualified Name (FQN)
If you have the fully qualified name (FQN) of a run, which follows the pattern tenant_name/ml_repo/run_name, you can use the
get_run_by_fqn
method:Python
Get All Runs for a Project
Get All Runs for a Project
To retrieve all the runs’ names and IDs for a project, use the
get_all_runs
method:Python
Search Runs
Search Runs
You can search for runs that match specific criteria using the
search_runs
method:Python
Get Tags for a Run
Get Tags for a Run
Get Parameters for a Run
Get Parameters for a Run
You can use the
get_params
method. It returns a dictionaryGet Metrics for a Run
Get Metrics for a Run
You can use the
get_metrics
method. It returns a dictionary.FAQs
Can anyone create a run under my ml_repo?
Can anyone create a run under my ml_repo?
You will need to have minimum of
Project Editor
role to create a run under a ml_repo. Project Viewer
role does not have permission to create a run.Can I use runs as a context manager?
Can I use runs as a context manager?
Yes, we can use runs as a context manager. A run will be automatically ended after the execution exits the
with
block.Are run names unique?
Are run names unique?
Yes. run names under a ml_repo are unique. If a run name already exists, we add a suffix to make it unique.
If you do not pass a run name while creating a run, we generate a random name.
If you do not pass a run name while creating a run, we generate a random name.
How runs are identified?
How runs are identified?
Runs are identified by by their
id
.