Write a Python program for applying CNN with considering the following requirements: Shuffle the cifar 10 training set x_train( each input with corresponding label in y_train ) Select 2500 images and you must ensure that each class must contain at least 180 samples Apply CNN that keeps noisy examples. Overall, the pseudocode of CNN is as follows: The code must contain at least one lambda expression The code must contain at one comprehension list It is Not allowed to use the numpy library. Euclidean distance is the distance between two samples in Euclidean space. The formula can be expressed as: USE THIS CODE import tensorflow import cv2 from tensorflow import keras from PIL import Image import numpy as p (x_train, y_train), (_, _) = tf.keras.datasets.cifar10.load_data() x_train = [cv2.cvtColor(image, cv2.COLOR_BGR2GRAY).flatten().tolist() for image in x_train] ##x_train=np.asarray(x_train) print(len(x_train)) print(len(x_train[0])) # 32*32 NOTE: PLEAS USE THE CODE I ATTACHED NOTE 2: pleas write code here so i can copy it
Write a Python program for applying CNN with considering the following requirements: Shuffle the cifar 10 training set x_train( each input with corresponding label in y_train ) Select 2500 images and you must ensure that each class must contain at least 180 samples Apply CNN that keeps noisy examples. Overall, the pseudocode of CNN is as follows: The code must contain at least one lambda expression The code must contain at one comprehension list It is Not allowed to use the numpy library. Euclidean distance is the distance between two samples in Euclidean space. The formula can be expressed as: USE THIS CODE import tensorflow import cv2 from tensorflow import keras from PIL import Image import numpy as p (x_train, y_train), (_, _) = tf.keras.datasets.cifar10.load_data() x_train = [cv2.cvtColor(image, cv2.COLOR_BGR2GRAY).flatten().tolist() for image in x_train] ##x_train=np.asarray(x_train) print(len(x_train)) print(len(x_train[0])) # 32*32 NOTE: PLEAS USE THE CODE I ATTACHED NOTE 2: pleas write code here so i can copy it
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Write a Python
- Shuffle the cifar 10 training set x_train( each input with corresponding label in y_train )
- Select 2500 images and you must ensure that each class must contain at least 180 samples
- Apply CNN that keeps noisy examples. Overall, the pseudocode of CNN is as follows:
-
- The code must contain at least one lambda expression
- The code must contain at one comprehension list
- It is Not allowed to use the numpy library.
Euclidean distance is the distance between two samples in Euclidean space. The formula can be expressed as:
USE THIS CODE
import tensorflow
import cv2
from tensorflow import keras
from PIL import Image
import numpy as p
(x_train, y_train), (_, _) = tf.keras.datasets.cifar10.load_data()
x_train = [cv2.cvtColor(image, cv2.COLOR_BGR2GRAY).flatten().tolist() for image in x_train]
##x_train=np.asarray(x_train)
print(len(x_train))
print(len(x_train[0])) # 32*32
NOTE: PLEAS USE THE CODE I ATTACHED
NOTE 2: pleas write code here so i can copy it
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education