Question: ` ` ` In [ 3 6 ] : #Run this self - test cell to check your code def calculate _ S _ dimensions
In : #Run this selftest cell to check your code
def calculateSdimensions:
X nprandom.rand # define random inputs
Z nprandom.rand # define random inputs
ndXshape
mdZshape
S calculateSX n m # compute distances from your solutions
ooSshape
return on and om
def calculateSaccuracy:
X nprandom.rand # define random inputs
S calculateSX Xshape # compute distances from your solutions
S calculateSgraderX Xshape #compute distance from ground truth
test nplinalg.normS S # compare the two
return teste # difference should be small
def calculateRdimensions:
X nprandom.rand # define random inputs
Z nprandom.rand # define random inputs
ndXshape
mdZshape
R calculateRZ n m # compute distances from your solutions
ooRshape
return on and om
def calculateRaccuracy:
Z nprandom.rand # define random inputs
R calculateRZ Zshape # compute distances from your solutions
R calculateRgraderZ Zshape #compute distance from ground truth
test nplinalg.normR R # compare the two
return teste # difference should be small
runtestcalculateSdimensions,'calculateSdimensions'
runtestcalculateSaccuracy,'calculateSaccuracy'
runtestcalculateRdimensions,'calculateRdimensions'
runtestcalculateRaccuracy,'calculateRaccuracy'
Rnning Test: ralrulate & dimencinns X FailedI
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
