Getting Started with Amazon SageMaker Studio Lab
Tags: aws, python, machinelearning, deeplearning
Published: 2021-12-12 14:55:43

The best way to learn data science and machine learning is with hands-on labs, tutorials and experimentations. Unfortunately, there are common pain points that add a layer of friction to get aspiring data scientists started.

These struggles include:

- setting up hardware like GPU or frameworks installation on personal laptops
- cloud-hosted ML environments are easy to set up but expensive
- lack persistent storage on free options (i.e. your data and environment will reset after the session expires)


## Introduction

In the latest AWS [re:Invent 2021](https://reinvent.awsevents.com), the AWS team announced the launch of SageMaker Studio Lab (currently in preview) to address these challenges and eliminate the setup hassle.

> Amazon Sagemaker Studio is a free, no-configuration service that allows developers, academics and data scientist to learn and experiment with machine learning.

Unlike SageMaker Notebook Instances or SageMaker Studio, where you need to set up an AWS account (and the need for a credit card), you now **only need** a valid **email address** to register for an account and start experimenting.


### Overview
AWS SageMaker Studio Lab is free (yes, FREE!). You can even choose between CPU or GPU, depending on your project needs.
Your account is allocated **15 GB** of persistent storage, and 16GB of RAM. What this means is you can save your project and dataset in the cloud (no need to start from scratch every time)

> For those who are familiar with AWS, the underlying resources are as follow — `G4dn.xlarge` for GPU and `T3.xlarge` for CPU instances (subject to change)


## Account Registration and Creation

1. Visit https://studiolab.sagemaker.aws/ and request an account. 

2. Fill up the form with your details
![Request Form (screenshot from author)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aano9abth0npn69xxpeo.png)

3. Wait for request approval (AWS claimed the process is _within 1 to 5 business days_. I have gotten my account approved the next day after my request)

4. Upon receiving your approval email, you can follow the account creation instruction, proceed with the sign-up link from the email.

![Account Creation (screenshot from author)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xzen1944a62mmij6mvd6.png)


## Exploring the Interface
Upon reaching the landing page, you will need to start your project runtime. You’ll need to select between CPU and GPU runtime, and the sessions last from 12 (CPU) and 4 (GPU) respectively.


![Home/Welcome page of SageMaker Studio Lab (screenshot from author)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cql1mahupp0w9jafof17.png)


Once the session is timed out, you will have to restart the project runtime again. Don’t worry, all your files will be saved on the persistent project storage.

![Check your remaining time for your session](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sl7yv7opwul8ccwyxnlr.png)


## Learn and Experiment

#### AWS Machine Learning University (MLU)
MLU notebooks contain materials used to train Amazon’s own developers on machine learning. Courses include

- Natural Language Processing
- Tabular Data
- Computer Vision
- Decision Trees and Ensemble Methods


#### Dive Into DeepLearning (D2L)
Interactive notebooks (over 150 Jupyter Notebooks) that teach the fundamentals of machine learning, adopted from 300 universities, including Stanford, MIT, Harvard and Cambridge.


#### Hugging Face
[Hugging Face](https://huggingface.co) is the home of the Transformers library and the latest NLP, speech and computer vision models. Here, you can explore and learn from the notebooks in this [repository](https://github.com/huggingface/notebooks).


## Jupyter Lab Interface
Since it is based on the open-source JupyterLab, you can take advantage of open-source Jupyter extensions to run your Jupyter notebooks.

You can also have full control with your (virtual) environment to leverage frameworks such as PyTorch, TensorFlow, MxNet, Hugging Face and libraries such as Scikit Learn, Pandas and NumPy.

![A typical Jupyter Lab interface on SageMaker Studio Lab (screenshot from author)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u63mn37csihreeej7s74.png)

You can clone your own Github repository and work on SageMaker Studio Lab as it has integration to Github and to Git for version control.


![Cloning your own repo to work on SageMaker Studio Lab (screenshot from author)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dolf0eil9anop0anui8m.png)

Furthermore, if you have a public Github repo with Jupyter Notebook, you can make it easy for others to open your notebooks in SageMaker Studio Lab.

All you need to do is to add the `Open in Studio Lab` link (badge) to your `README.md` file or notebook. The markdown to be included is as follow:

```
[![Open In Studio Lab]
(https://studiolab.sagemaker.aws/studiolab.svg)]
(https://studiolab.sagemaker.aws/import/github/org/repo/blob/master/path/to/notebook.ipynb)
```

The created badge will look like this.

![“Open in Studio Lab” badge](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zrabcn4z56pw5l374h7.png)

## Bonus: Hackathon

![AWS Disaster Response Hackathon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0865upbqzyoocpye2yt.png)

At the time of writing (December 2021), there’s an ongoing hackathon (AWS Disaster Response Hackathon) where you can explore and train your models in SageMaker Studio Lab. The deadline is 7 Feb 2022, 5:00 pm EST.

Read more:
https://awsdisasterresponse.devpost.com 


Thank you for reading this article and I hope you will find it insightful. Get your SageMaker Studio Lab before the waitlist is getting longer.


Happy learning everyone.