QuestionQuestion

Transcribed TextTranscribed Text

WS-9 Bonus TASK (5 marks) Take random 10 MNIST images, each image is 28 X 28. For each image, create an image vector of 1x784 (i.e. rows of pixels in the image are placed one after the other to form a 1D image) Put all the images together in one big image-matrix, given as: ImageVecl MNIST_ImageMatrix = ImageVec2 ImageVee20 Apply PCA (with 154 components) + explain each of the following in your own words: 2.1. Find eigenvector transformation: FinalData = RowFeatureVector X RowDataAdjust 2.2. Find: RowDataAdjust = RowFeatureVector" X FinalData 2.3. Find: RowOriginalData = (RowFeatureVector² X FinalData) + OriginalM ear 2.4. Compare with 154 (hidden) neurons Autoencoder (From Lecture 8)

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import numpy as np
import matplotlib.pyplot as plt
import scipy.linalg as la

import input_data

mnist = input_data.read_data_sets("MNIST_Data/", one_hot=False)
batch = mnist.train.next_batch(10)

data = batch[0]

for i in range(10):
    data[i] = data[i] - np.mean(data[i])
   
   
cov_data=np.cov(data)

eig_vec = la.eig(cov_data)

max_arg=np.argmax(eig_vec[0])

max_eig_vec=np.array([eig_vec[1][max_arg]])

max_eig_vec_inv=np.linalg.inv(eig_vec[1])[max_arg]

max_eig_vec_inv = np.reshape(max_eig_vec_inv,(1,10))

final_data = np.matmul(max_eig_vec,data) #eigen vectors...
$165.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Artificial Intelligence Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats