SDK-driven Workflow
Last updated
Last updated
The document below covers the process of creating an image classification model with the MNIST dataset using the . Once again, we will
Build a baseline machine learning model with .
Optimize hyperparameters using .
Update and store models on .
You can follow along the same guide on the as well.
To follow this guide, you should first have the following setup.
— a dedicated organization for you or your team
— a space for your machine learning model and mounted datasets
— Python SDK and CLI to manage ML workflows and resources on VESSL
If you have not created an Organization or a Project, first follow the instructions on the .
Let's start by configuring the client with the default organization and project we have created earlier. This is done by executing .
The metrics summary of the experiment is stored as a Python dictionary. You can check the latest metrics using metrics_summary.latest
as follows.
Then, run vessl.create_model()
with the name and ID of the destination repository and experiment we just created.
Next, define the search space of parameters
. In this example, the optimizer
is a categorical
type and the option values are listed as an array. The batch_size
is an int value and the search space
is set using max, min, and step.
You can get the details of the sweep by calling the variable or by visiting the web console.
You can view the performance of your model by using vessl.read_model()
and specifying the model repository followed by the model number.
We have looked at the overall workflow of using the VESSL Client SDK. We can also repeat the same process using the client CLI or through Web UI. Now, try this guide with your own code and dataset.
You can always re-configure your organization and project by calling anytime.
To create a on VESSL, run . Let's create a dataset from the public AWS S3 dataset we have prepared: s3://savvihub-public-apne2/mnist
. You can check that your dataset was created successfully by executing the dataset's variable name.
To create an , use . Let's run an experiment using VESSL's managed clusters. First, specify the and options. Then, specify the image URL — in this case, we are pulling a Docker image from . Next, we are going to mount the dataset we have created previously. Finally, let's specify the that will be executed in the experiment container. Here, we will use the MNIST Keras example from our .
Note that you can also with your so you don't have to git clone
every time you create an experiment. For more information about these features, please refer to the page.
The experiment may take a few minutes to complete. You can get the details of the experiment, including its status, by using .
In VESSL, you can create a . First, let's start by creating a model repository using vessl.create_model_repository()
and specifying the repository name.
So far, we ran a single machine learning and saved it as a inside a model repository. In this section, we will use a to find the optimal hyperparameter value.
First, configure sweep_objective
with the target metric name and target value. Note that the metric must be a logged to VESSL using .
Initiate hyperparameter searching using . You can see in the code below that the options for cluster, resource, image, dataset, and command options has been set similar to the vessl experiment create
explained above.
Now that we have run several experiments using , let's find the optimal experiment. returns the experiment information with the best metric value set in sweep_objective
. In this example, this will return the details of the experiment with the maximum val_accuracy
.
Using the output of best_experiment
, let's create a v0.0.2
model with .