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
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 

NOTE 2: pleas write code here so i can copy it

+
و مترجم - بحث Go ogle
X Untitled4 - Jupyter Noteb
x CSC 605_HW1 - Jupyter N
X Downloads/csc/
O x Answered: Write a Python b
localhost:8888/notebooks/Downloads/csc/CSC%20605_HW1.ipynb O
قائمة القراءة
| bartleby b sQL for Beginners. û Black. - jolyó li>yo B Google biljs A YouTube
Gmail M Släuhill
jupyter cSC 1.°_HW' Last Checkpoint: :rio l dio ual (autosaved)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Not Trusted
Python 3 O
个
Run
C » 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[e])) # 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
P Type here to search
87°F A O O
DG 4) ENG
9/27/2021
Transcribed Image Text:+ و مترجم - بحث Go ogle X Untitled4 - Jupyter Noteb x CSC 605_HW1 - Jupyter N X Downloads/csc/ O x Answered: Write a Python b localhost:8888/notebooks/Downloads/csc/CSC%20605_HW1.ipynb O قائمة القراءة | bartleby b sQL for Beginners. û Black. - jolyó li>yo B Google biljs A YouTube Gmail M Släuhill jupyter cSC 1.°_HW' Last Checkpoint: :rio l dio ual (autosaved) Logout File Edit View Insert Cell Kernel Widgets Help Not Trusted Python 3 O 个 Run C » 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[e])) # 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 P Type here to search 87°F A O O DG 4) ENG 9/27/2021
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education