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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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 

THANK YOU

+ x
Google u - G X Untitled4 - Jupyter Notebe
X CSC 605_HW1 - Jupyter N
X Downloads/csc/
C X Answered: Write a Python b
localhost:8888/notebooks/Downloads/csc/CSC%20605_HW1.ipynb O
->
f
قائمة القراءة
| bartleby
SQL for Beginners:. û
B مرحبّا, فياض - ..Black
Google hiljs A
YouTube
Gmail M
التطبيقات
Cjupyter CSC 1._HW) Last Checkpoint: ) :. Y delul die ws (autosaved)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Not Trusted
Python 3 O
+
Run
Markdown
pip install tensorflow
Then, use the following code:
In [63]: 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[@])) # 32*32
<IPython.core.display.Javascript object>
50000
1024
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
11:14 PM
O Type here to search
87°F
D G ») ENG
9/27/2021
Transcribed Image Text:+ x Google u - G X Untitled4 - Jupyter Notebe X CSC 605_HW1 - Jupyter N X Downloads/csc/ C X Answered: Write a Python b localhost:8888/notebooks/Downloads/csc/CSC%20605_HW1.ipynb O -> f قائمة القراءة | bartleby SQL for Beginners:. û B مرحبّا, فياض - ..Black Google hiljs A YouTube Gmail M التطبيقات Cjupyter CSC 1._HW) Last Checkpoint: ) :. Y delul die ws (autosaved) Logout File Edit View Insert Cell Kernel Widgets Help Not Trusted Python 3 O + Run Markdown pip install tensorflow Then, use the following code: In [63]: 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[@])) # 32*32 <IPython.core.display.Javascript object> 50000 1024 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 11:14 PM O Type here to search 87°F D G ») ENG 9/27/2021
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY