Question: In [ 2 4 ] : def calculate _ S ( X , n , m ) : , function calculate _ S ( X

In [24]: def calculate_S(X, n, m):
,
function calculate_S(X)
Computes the S matrix.
Syntax:
S=calculate_S(X)
Input:
X: nxd data matrix with n vectors (rows) of dimensionality d
n : number of rows in X
m : output number of columns in S
Output:
Matrix S of size nxm
S[i,j] is the inner-product between vectors \(\mathrm{X}[\mathrm{i},:]\) and \(\mathrm{X}[\mathrm{i},:]\)
assert \(\mathrm{n}==\mathrm{X}\).shape[0]
\# YOUR CODE HERE
raise NotImplementedError()
In [25]: def calculate_R(Z, n, m):
function calculate_R(Z)
Computes the R matrix.
Syntax:
R=calculate_R(Z)
Input:
Z: mxd data matrix with m vectors (rows) of dimensionality d
n : output number of rows in Z
m : number of rows in Z
Output:
Matrix R of size nxm
\( R[i, j]\) is the inner-product between vectors \( Z[j,:]\) and \( Z[j,:]\)
assert m == Z.shape[0]
\# YOUR CODE HERE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!