Machine Learning – Neural Networks Dataset: In this dataset we will use the MNIST handwritten image dataset. http://yann.lecun.com/exdb/mnist/ Part 1: Download and run the basic tutorial here:...


Machine Learning – Neural Networks

Dataset:

In this dataset we will use the MNIST handwritten image dataset. http://yann.lecun.com/exdb/mnist/


Part 1:


Download and run the basic tutorial here:


https://www.tensorflow.org/tutorials/quickstart/beginner


Try 5different variations of the following code by changing parameters:


model = tf.keras.models.Sequential([


tf.keras.layers.Flatten(input_shape=(28, 28)),


tf.keras.layers.Dense(128, activation='relu'),


tf.keras.layers.Dropout(0.2),


tf.keras.layers.Dense(10)


])


FOR EACH of the edits you make and things you try


ØWhat is the performanceyou obtain with these changes?


ØWrite up your observations for each edit/tryin a separate codeblock at the end of your jupyter notebook.


Submit this notebook as part_1.ipynb file


Part 2 : Running a non-deep Neural Network


1. Use the same code blocks as above to process the image data.


2. Invoke the sklearn MLP code from here: https://scikitlearn.


org/stable/modules/neural_networks_supervised.html


3. What is the accuracy you obtain with these methods after trying different combinations of the


hyperparameters for the structure and epoch etc.for the backprop neural net?


4. Write up your observations in a separate codeblock at the end of your jupyter notebook. Submit this


notebook as part 2.ipynb file




Microsoft Word - Assignment_3_Neural Networks.docx Assignment #3 Machine Learning – Neural Networks Overview: The goal of this assignment are: 1. Further develop your understanding of the data science/ML process 2. Familiarize yourself with Python libraries including: numpy, sklearn, matplotlib, seaborn and others. 3. Be able to handle common tasks such as file parsing and feature transformation 4. Design and implement a neural network classifier. 5. Handle image data. 6. Be able to plot and visually explore the different data characteristics 7. Demonstrate that the algorithm you have designed produces similar results as the out of the box NN algorithm available from sklearn. You may collaborate on this with others but you must follow the rules as outlined in the syllabus and not examine or share code or copy/plagiarize from others online. Cite any references. Submission: Upload a zip file named your ‘fname_lastname_A3’ containing: 1. Output directory to store all outputs your code generates in terms of results, charts, etc. that you want to persist. Do not output data to the output directory and increase the zip file size. 2. Jupyter Notebook with code and appropriate functions and comments. Background(ForReferenceOnly): 1. Anaconda Installation: https://www.anaconda.com/products/individual This is the easiest toolkit that millions of data scientists use for individual work. It is open-source and one stop shop for most libraries you will need. Once you install conda you get an environment with notebooks etc. It has both UI portal or you can use CLI of your OS of choice be it windows, mac or linux. 2. Jupyter Notebooks: The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more. (jupyter.org description) 3. A notebook is made up of sequence of cells. Cell can be Code or cell can be Markdown. We use code cells running python 3.9 or the default version that comes with your anaconda install. 4. You can save jupyter notebooks as html files. 5. Download and review closely this example machine learning notebook by Randall S. Olson: https://nbviewer.jupyter.org/github/rhiever/Data-Analysis-and-Machine-Learning- Projects/blob/master/example-data-science- notebook/Example%20Machine%20Learning%20Notebook.ipynb This notebook is a great starting point to start thinking through the process of data science and machine learning. It uses the IRIS data. Dataset: In this dataset we will use the MNIST handwritten image dataset. http://yann.lecun.com/exdb/mnist/ AssignmentTasks: Formatted: Font: Bold Assignment #3 Machine Learning – Neural Networks Part1(50points): Download and run the basic tutorial here: https://www.tensorflow.org/tutorials/quickstart/beginner Try 5 different variations of the following code by changing parameters: model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10) ]) FOR EACH of the edits you make and things you try Ø What is the performance you obtain with these changes? Ø Write up your observations for each edit/try in a separate codeblock at the end of your jupyter notebook. Submit this notebook as part_1.ipynb file Part2(50points):Runninganon-deepNeuralNetwork 1. Use the same code blocks as above to process the image data. 2. Invoke the sklearn MLP code from here: https://scikit- learn.org/stable/modules/neural_networks_supervised.html 3. What is the accuracy you obtain with these methods after trying different combinations of the hyperparameters for the structure and epoch etc. for the backprop neural net? 4. Write up your observations in a separate codeblock at the end of your jupyter notebook. Submit this notebook as part 2.ipynb file Guidelines: Usage to invoke and test your code: If downstream functions need the output data then you can persist the output in a dataframe or other data structure. If you create new features you may want to persist them if you find them useful to augment the dataset. Style requirements: • a great primer From Google: https://developers.google.com/machine-learning/guides/rules-of- ml • Coding Style Guidelines for deep learning and python based ML in general. http://deeplearning.net/software/pylearn/v2_planning/API_coding_style.html Formatted: Font: Bold Formatted: Font: (Default) CMR10, 10 pt Formatted: List Paragraph, Bulleted + Level: 1 + Aligned at: 0.25" + Indent at: 0.5", Adjust space between Latin and Asian text, Adjust space between Asian text and numbers Deleted: accuracy Deleted: ¶ Formatted: Font: (Default) CMR10, 10 pt Formatted: List Paragraph, Bulleted + Level: 1 + Aligned at: 0.25" + Indent at: 0.5" Formatted: Font: (Default) CMR10, 10 pt Deleted: Deleted: Deleted: Assignment #3 Machine Learning – Neural Networks • Break your code into multiple functions. Represent decision nodes and decision trees as objects. Here is a decent primer on how to do OOP in Python 3: https://realpython.com/python3-object- oriented-programming/ Checks before you submit: 1. Did you include a README.md? 2. Did you remove debug comments and code and print statements for your own development work? 3. Did you clean up your notebooks and remove any non-trivial functions/portions? 4. Is your code commented for others to consume? 5. Is it easy to follow? 6. Is your code able to run if you upload and package everything in a zip and then open that zip on another machine or in any other directory? References: Numerous references to links are included in material above but some others that you may find useful: 1. https://machinelearningmastery.com/adam-optimization-algorithm-for-deep-learning/ 2. https://machinelearningmastery.com/learning-rate-for-deep-learning-neural-networks/ 3. https://cs231n.github.io/convolutional-networks/
May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here