Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
No: TypeScript remains the best language for structuring large enterprise applications.
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
I don’t know and I don’t care.
Software Development

Take Amazon SageMaker Studio Lab for a Spin

In this tutorial, we will walk you through the steps of training an end-to-end deep learning model to perform image classification based on Amazon SageMaker Studio Lab.
Dec 20th, 2021 4:00am by
Featued image for: Take Amazon SageMaker Studio Lab for a Spin

Introduced  as a preview at the Amazon Web Services‘ re:Invent 2021 conference, SageMaker Studio Lab is a free stand-alone machine learning development environment based on the popular JupyterHub IDE.  Except for the branding, the service has almost nothing to do with SageMaker. For a detailed overview of the service, read my previous article.

In this tutorial, I will walk you through the steps of training an end-to-end deep learning model to perform image classification based on Amazon SageMaker Studio Lab. We will build a model that distinguishes between cats and dogs (Be sure to check back all this week for additional SageMaker Studio Lab tutorials).

Step 1: Request Access and Sign In

Visit to request a free Amazon SageMaker Studio Lab account.

Studio lab landing page

request account

It may take a few hours to a couple of days for you to get access to the environment. Wait for the email confirmation.

account ready

Once approved, sign in to your account with the credentials.

sign in

Select GPU compute type, and click on the Start runtime button.

start runtime

When the runtime is ready, click on Open project.

Open project

The JupyterHub environment is ready for experimentation.

Ready for experimentation

Step 2: Preparing the Environment

From the launcher, click on the terminal icon to start a new terminal session. Clone the Git repository that has the Conda environment configuration and the notebooks.

git clone

Navigate to the the dogs-vs-cats folder, and right click on env_tf2.yaml file to create a new Conda environment. This file has all the modules needed to train a TensorFlow/Keras model.

Pull in variables

Studio lab environ

Refresh the browser to see a new kernel named tf2:Python

New kernel

Before we can start training the model, we need to download the dataset. For this, login to Kaggle and download the file from the Dogs vs. Cats competition.

Download the dataset

Upload the file, into the dataset folder of the repo that we cloned in the previous step. Launch a terminal session and unzip the file in the same folder. You should now have a new folder — /dogs-vs-cats/dataset/train/.

We now have the environment fully configured to kickoff the training job within Amazon SageMaker Studio Lab.

Step 3: Train the Computer Vision Model to Classify Images

Navigate to the train folder of the repository and launch dogs-vs-cats.ipynb notebook.

Train the model to classify images

If prompted for the kernel, choose tf2:Python.

select the kernel

This notebook loads the dataset we downloaded and trains the image classification model. Run the cells to complete the training. It may take up to 15 minutes for the training to complete.

In my experiment, the model was trained with an accuracy of 87.5%. This may be improved by increasing the number of epochs.

Training the model

When the model is ready, it is exported to the model/export/Servo/1 directory in the TensorFlow Serving format.

Export the model

Step 3: Perform Inference on the Trained Model

Navigate to the infer folder to open the inference notebook. We load the saved model from /model/export/Servo/1/ and use it for inference.

model = tensorflow.keras.models.load_model("../model/export/Servo/1/")

When an image is appropriately resized and preprocessed, it can be sent to the model. Below are the screenshots predicting the correct classes.

Perform inference

More inference training

You can easily upload the model to Amazon S3 using the Python Boto3 module to deploy it in Amazon SageMaker.

In the next part of this series — which will run all this week — we will utilize the image classification model to create a serverless inference endpoint in Amazon SageMaker. Stay tuned.

Group Created with Sketch.
TNS owner Insight Partners is an investor in: Pragma.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.