Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

DS-UA 301

Advanced Topics in Data Science

Homework 5 - 100 points

Due: May 30, 2023

Problem 1 - Automated Feature Engineering     15 points

In the lab, we looked at AutoFeat (https://github.com/cod3licious/autofeat), a python library that auto- matically does feature engineering and selection for you.

1.  Explain the importance of interpretability when training machine learning models.   Why is model explainability necessary?   (2)

2.  Perform feature selection for the Diabetes regression dataset using FeatureSelector().  How many fea- tures are discarded?   (4)

3.  Perform a train-test split on your dataset.  Select a regression model from skLearn and fit it to the training dataset. What is the R2  score on the training and test set?   (4)

4.  Keeping the train and test dataset same, run 3 feature engineering steps using AutoFeatRegressor(). What is the R2  score on the training and test set now?  Mention any five new features generated by the output of AutoFeatRegressor().   (5)

Problem 2 - Ray Tune for Hyperparameter Optimization     15 points

In this problem,  we will compare the performance of Grid  Search,  Bayesian  Search and Hyperband for hyperparameter optimization for a deep learning problem using Ray Tune. We will use the MNIST dataset alongwith the Lenet model. The hyperparameters to tune are:

• Number of filters in the first Conv2d layer: 64 to 256

• Learning Rate: 0.001 to 0.1

• Batch Size: 64,128,256

• Dropout: probability between 0 and 1

Use Ray Tune (https://docs.ray.io/en/latest/tune/index.html) for the search. You can use the same resources per trial and metric as those in Lab 8 and Lab 10 in class.

1.  Perform Grid Search, Bayesian Search and Hyperband for the given hyperparameter configurations. For Grid Search, you can either sample uniformly between the given ranges, or specify a list of values in the given range (for e.g., filters = [64,128,256], lr=[0.001,0.01,0.1], etc).   (8)

2.  For each of the search technique in part 1, display the time taken to perform the analysis and display the hyperparameters for the best model.   (4)

3. What are your observations regarding time taken and performance of the best model?   (3)

Problem 3 - SSD, ONNX model,  Visualization, Inferencing     25 points

In this problem we will be inferencing SSD ONNX model using ONNX Runtime Server. You will follow the github repo and ONNX tutorials (links provided below). You will start with a pretrained Pytorch SSD model and retrain it for your target categories. Then you will convert this Pytorch model to ONNX and deploy it on ONNX runtime server for inferencing.

1.  Download pretrained pytorch MobilenetV1 SSD and test it locally using Pascal VOC 2007 dataset. Show the test accuracy for the 20 classes.   (4)

2.  Select any two related categories from Google Open Images dataset and finetune the pretrained SSD model. Examples include, Aircraft and Aeroplane, Handgun and Shotgun. You can use                        open_images_downloader .py script provided at the github to download the data. For finetuning you can use the same parameters as in the tutorial below. Compute the accuracy of the test data for these categories before and after finetuning.   (4+4)

3.  Convert the Pytorch model to ONNX format and save it.   (4)

4.  Deploy the ONNX model on ONNX runtime (ORT) server. You can refer to the lab for instructions on how to do this. Test the inferencing set-up using 1 image from each of the two selected categories.   (5)

5.  Parse the response message from the ORT server and annotate the two images. Show inferencing output (bounding boxes with labels) for the two images.   (4)

For part 1, 2, and 3, refer to the steps in the github repo.  For part 4 and 5 refer to ONNX tutorial on inferencing and the lab.

References

• Github repo. Shot MultiBox Detector Implementation in Pytorch. Available at https://github.com/qfgaohao/pytorch-ssd

• ONNX tutorial. Inferencing SSD ONNX model using ONNX Runtime Server.

Available at https://github.com/onnx/tutorials/blob/master/tutorials/OnnxRuntimeServerSSDModel.ipynb

• Google. Open Images Dataset V5 + Extensions.

Available at https://storage.googleapis.com/openimages/web/index.html

• The PASCAL Visual Object Classes Challenge 2007.

Available at http://host.robots.ox.ac.uk/pascal/VOC/voc2007/

Problem 4 - ML Cloud Platforms    20 points

In this  question you will  analyze  different  ML  cloud platforms  and  compare their  service offerings.   In particular, you will consider ML cloud offerings from IBM, Google, Microsoft, and Amazon and compare them on the basis of following criteria:

1.  Frameworks: DL framework(s) supported and their version.   (4)

Here we  are referring to machine  learning platforms which have their own inbuilt images for different frameworks .

2.  Compute units: type(s) of compute units offered, i.e., GPU types.   (1)

3.  Model lifecycle management: tools supported to manage ML model lifecycle.   (2)

4.  Monitoring: availability of application logs and resource (GPU, CPU, memory) usage monitoring data to the user.   (3)

5. Visualization during training: performance metrics like accuracy and throughput  (2)

6.  Training job description:  training job description file format.   Show how the same training job is specified in different ML platforms using an example job. Identify similar fields in the training job file for the 4 ML platforms through an example.   (8)

Problem 5 - Deep Reinforcement Learning    25 points

This question is based on Deep RL concepts discussed in Lecture 8. You need to refer to the papers by Mnih et al., Nair et al., and Horgan et al. to answer this question. All papers are linked below.

1.  Explain the difference between episodic and continuous tasks? Given an example of each.   (2)

2. What do the terms exploration and exploitation mean in RL ? Why do the actors employ e-greedy policy for selecting actions at each step? Should e remain fixed or follow a schedule during Deep RL training ? How does the value of e help balance exploration and exploitation during training.   (1+1+1+1)

3.  How is the Deep Q-Learning algorithm different from Q-learning ?  You will follow the steps of Deep Q-Learning algorithm in Mnih et al.  (2013) page 5, and explain each step in your own words.   (3)

4. What is the benefit of having a target Q-network ?   (4)

5.  How does experience replay help in efficient Q-learning ?   (4)

6. What is prioritized experience replay? Explain how priority is calculated for different experiences?   (4)

7.  Compare and contrast GORILA (General Reinforcement Learning Architecture) and Ape-X architec- ture. Provide three similarities and three differences.   (4)

References

• Mnih et al. Playing Atari with Deep Reinforcement Learning. 2013 Available at https://arxiv.org/pdf/1312.5602.pdf

• Nair et al. Massively Parallel Methods for Deep Reinforcement Learning. 2015 Available at https://arxiv.org/pdf/1507.04296.pdf

• Horgan et al. Distributed Prioritized Experience Replay. 2018 Available at https://arxiv.org/pdf/1803.00933.pdf