Created
February 26, 2021 02:43
-
-
Save Crazz-Zaac/a53af27a3e1c6f951ccb1a0da45a58fa to your computer and use it in GitHub Desktop.
Computing style matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Style matrix is also called gram matrix. For our simplicity, we define it as gram matrix | |
def gram_matrix(A): | |
""" | |
Argument: | |
A -- matrix of shape (n_C, n_H*n_W) | |
Returns: | |
GA -- Gram matrix of A, of shape (n_C, n_C) | |
""" | |
### START CODE HERE ### (≈1 line) | |
GA = tf.matmul(A, tf.transpose(A)) | |
### END CODE HERE ### | |
return GA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment