profrponnusamy
Uploaded by
10 SLIDES
23 VUES
0LIKES

Deep Learning - AD3501 - Notes - Codes for Practical

DESCRIPTION

This is deep learning lecture notes

1 / 10

Télécharger la présentation

Deep Learning - AD3501 - Notes - Codes for Practical

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Click on Subject/Paper under Semester to enter. Environmental Sciences and Sustainability - GE3451 Discrete Mathematics - MA3354 Professional English - II - HS3252 Professional English - I - HS3152 Digital Principles and Computer Organization - CS3351 Statistics and Numerical Methods - MA3251 Probability and Statistics - MA3391 Matrices and Calculus - MA3151 3rd Semester 1st Semester 4th Semester 2nd Semester Database Design and Management - AD3391 Operating Systems - AL3452 Engineering Graphics - GE3251 Engineering Physics - PH3151 Design and Analysis of Algorithms - AD3351 Physics for Information Science - PH3256 Machine Learning - AL3451 Engineering Chemistry - CY3151 Fundamentals of Data Science and Analytics - AD3491 Data Exploration and Visualization - AD3301 Basic Electrical and Electronics Engineering - BE3251 Problem Solving and Python Programming - GE3151 Artificial Intelligence - AL3391 Computer Networks - CS3591 Data Structures Design - AD3251 Deep Learning - AD3501 Embedded Systems and IoT - CS3691 Data and Information Security - CW3551 Human Values and Ethics - GE3791 5th Semester 6th Semester 7th Semester 8th Semester Open Elective-1 Distributed Computing - CS3551 Open Elective 2 Project Work / Intership Elective-3 Open Elective 3 Big Data Analytics - CCS334 Elective-4 Open Elective 4 Elective-5 Elective 1 Management Elective Elective-6 Elective 2

  2. (Click on Subjects to enter) Operating Systems Problem Solving and Python Programming Analog and Digital Communication Object Oriented Analysis and Design Internet Programming Distributed Systems Digital Signal Processing Grid and Cloud Computing Resource Management Techniques Multi - Core Architectures and Programming Transforms and Partial Differential Equations Engineering Chemistry Professional Ethics in Engineering Environmental Science and Engineering All Computer Engg Subjects - [ B.E., M.E., ] Programming in C Programming and Data Structures I Database Management Systems Computer Networks Programming and Data Structure II Computer Architecture Design and Analysis of Algorithms Software Engineering Theory of Computation Mobile Computing Artificial Intelligence Data Ware Housing and Data Mining Service Oriented Architecture Embedded and Real Time Microprocessors and Microcontrollers Discrete Mathematics Computer Graphics Compiler Design Software Testing Cryptography and Network Security Systems Probability and Queueing Theory Physics for Information Science Technical English Engineering Graphics Engineering Physics Total Quality Management Problem Solving and Python Programming Basic Electrical and Electronics and Measurement Engineering

  3. lOMoARcPSD|45333583 www.BrainKart.com 1. Construct a simple neural network performing classification on MNIST Handwritten Digit dataset Program: import tensor昀氁ow as 琀昁 from tensor昀氁ow.keras import datasets, layers, models (x_train, y_train), (x_test, y_test)=datasets.mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 model = models.Sequen琀椁al([ layers.Fla琀琁en(input_shape=(28, 28)), layers.Dense(512, ac琀椁va琀椁on='relu'), layers.Dense(10, ac琀椁va琀椁on='so昀琁max') ]) model.compile(op琀椁mizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.昀椁t(x_train, y_train, epochs=5) loss, acc = model.evaluate(x_test, y_test) print('Test accuracy:', acc) 2. Build a CNN and train it with the Labeled Faces in the Wild dataset to determine how well a CNN can be trained to perform facial recognition Program: import tensorflow as tf from tensorflow.keras import layers, models from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes

  4. lOMoARcPSD|45333583 www.BrainKart.com from sklearn.metrics import accuracy_score from sklearn.datasets import fetch_lfw_people from sklearn.decomposition import PCA import numpy as np lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) n_samples, h, w = lfw_people.images.shape X = lfw_people.data y = lfw_people.target X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) X_train = X_train / 255.0 X_test = X_test / 255.0 label_encoder = LabelEncoder() y_train = label_encoder.fit_transform(y_train) y_test = label_encoder.transform(y_test) X_train = X_train.reshape(-1, h, w, 1) X_test = X_test.reshape(-1, h, w, 1) model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(h, w, 1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.Flatten()) model.add(layers.Dense(128, activation='relu')) model.add(layers.Dense(len(label_encoder.classes_), activation='softmax')) https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes

  5. lOMoARcPSD|45333583 www.BrainKart.com model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(X_train, y_train, epochs=10, validation_split=0.2) test_loss, test_acc = model.evaluate(X_test, y_test) print(f'Test accuracy: {test_acc}') predictions = model.predict(X_test) predicted_labels = np.argmax(predictions, axis=1) accuracy = accuracy_score(y_test, predicted_labels) print(f'Accuracy on test set: {accuracy}') 3. Build a Deep Neural Network for XOR problem using Keras Program: import tensorflow as tf from tensorflow import keras import numpy as np X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]]) y = np.array([0, 1, 1, 0]) model = keras.Sequential([ keras.layers.Dense(4, activation='relu', input_shape=(2,)), keras.layers.Dense(8, activation='relu'), keras.layers.Dense(1, activation='sigmoid') ]) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes

  6. lOMoARcPSD|45333583 www.BrainKart.com model.fit(X, y, epochs=500) predictions = model.predict(X) print(predictions) 4. Implement handwritten digit classification using Neural Network Program: mport tensor昀氁ow as 琀昁 from tensor昀氁ow import keras from tensor昀氁ow.keras import datasets, layers, models (x_train, y_train), (x_test, y_test) = datasets.mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 model = models.Sequen琀椁al([ layers.Fla琀琁en(input_shape=(28, 28)), layers.Dense(512, ac琀椁va琀椁on='relu'), layers.Dense(10, ac琀椁va琀椁on='so昀琁max') ]) model.compile(op琀椁mizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.昀椁t(x_train, y_train, epochs=5) loss, acc = model.evaluate(x_test, y_test) print('Test accuracy:', acc) 8. Perform Language modeling using RNN: https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes

  7. lOMoARcPSD|45333583 www.BrainKart.com Program: import numpy as np import tensor昀氁ow as 琀昁 from tensor昀氁ow.keras.models import Sequen琀椁al from tensor昀氁ow.keras.layers import LSTM, Dense path = 琀昁.keras.u琀椁ls.get_昀椁le('shakespeare.txt', 'h琀琁ps://storage.googleapis.com/download.tensor昀氁ow.org/data/shakespeare.txt') text = open(path, 'rb').read().decode(encoding='u琀昁-8') vocab = sorted(set(text)) char2idx = {u: i for i, u in enumerate(vocab)} idx2char = np.array(vocab) text_as_int = np.array([char2idx[c] for c in text]) seq_length = 100 examples_per_epoch = len(text) // (seq_length + 1) char_dataset = 琀昁.data.Dataset.from_tensor_slices(text_as_int) sequences = char_dataset.batch(seq_length + 1, drop_remainder=True) def split_input_target(chunk): input_text = chunk[:-1] target_text = chunk[1:] return input_text, target_text dataset = sequences.map(split_input_target) BATCH_SIZE = 64 BUFFER_SIZE = 10000 https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes

  8. lOMoARcPSD|45333583 www.BrainKart.com dataset = dataset.shu昀渁e(BUFFER_SIZE).batch(BATCH_SIZE, drop_remainder=True) vocab_size = len(vocab) embedding_dim = 256 rnn_units = 1024 def build_model(vocab_size, embedding_dim, rnn_units, batch_size): model = Sequen琀椁al([ 琀昁.keras.layers.Embedding(vocab_size, embedding_dim, batch_input_shape=[batch_size, None]), 琀昁.keras.layers.LSTM(rnn_units, return_sequences=True, stateful=True, recurrent_ini琀椁alizer='glorot_uniform'), 琀昁.keras.layers.Dense(vocab_size) ]) return model model = build_model(vocab_size, embedding_dim, rnn_units, BATCH_SIZE) model.compile(op琀椁mizer='adam', loss=琀昁.keras.losses.SparseCategoricalCrossentropy(from_logits=True)) epochs = 10 history = model.昀椁t(dataset, epochs=epochs) model.save('language_model_rnn.h5') https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes

  9. Click on Subject/Paper under Semester to enter. Environmental Sciences and Sustainability - GE3451 Discrete Mathematics - MA3354 Professional English - II - HS3252 Professional English - I - HS3152 Digital Principles and Computer Organization - CS3351 Statistics and Numerical Methods - MA3251 Probability and Statistics - MA3391 Matrices and Calculus - MA3151 3rd Semester 1st Semester 4th Semester 2nd Semester Database Design and Management - AD3391 Operating Systems - AL3452 Engineering Graphics - GE3251 Engineering Physics - PH3151 Design and Analysis of Algorithms - AD3351 Physics for Information Science - PH3256 Machine Learning - AL3451 Engineering Chemistry - CY3151 Fundamentals of Data Science and Analytics - AD3491 Data Exploration and Visualization - AD3301 Basic Electrical and Electronics Engineering - BE3251 Problem Solving and Python Programming - GE3151 Artificial Intelligence - AL3391 Computer Networks - CS3591 Data Structures Design - AD3251 Deep Learning - AD3501 Embedded Systems and IoT - CS3691 Data and Information Security - CW3551 Human Values and Ethics - GE3791 5th Semester 6th Semester 7th Semester 8th Semester Open Elective-1 Distributed Computing - CS3551 Open Elective 2 Project Work / Intership Elective-3 Open Elective 3 Big Data Analytics - CCS334 Elective-4 Open Elective 4 Elective-5 Elective 1 Management Elective Elective-6 Elective 2

  10. (Click on Subjects to enter) Operating Systems Problem Solving and Python Programming Analog and Digital Communication Object Oriented Analysis and Design Internet Programming Distributed Systems Digital Signal Processing Grid and Cloud Computing Resource Management Techniques Multi - Core Architectures and Programming Transforms and Partial Differential Equations Engineering Chemistry Professional Ethics in Engineering Environmental Science and Engineering All Computer Engg Subjects - [ B.E., M.E., ] Programming in C Programming and Data Structures I Database Management Systems Computer Networks Programming and Data Structure II Computer Architecture Design and Analysis of Algorithms Software Engineering Theory of Computation Mobile Computing Artificial Intelligence Data Ware Housing and Data Mining Service Oriented Architecture Embedded and Real Time Microprocessors and Microcontrollers Discrete Mathematics Computer Graphics Compiler Design Software Testing Cryptography and Network Security Systems Probability and Queueing Theory Physics for Information Science Technical English Engineering Graphics Engineering Physics Total Quality Management Problem Solving and Python Programming Basic Electrical and Electronics and Measurement Engineering

More Related