Understanding the rbf cost code #291
-
Hello, I hope this question is not because I am rusty in linear algebra but I have been struggling to understand how $c(y_{I}) = \sum_{t \in I}||\Phi(y_{t})- \overline{\mu}{t}| |^2{H}$ became this in the code: sub_gram = self.gram[start:end, start:end]
val = np.diagonal(sub_gram).sum()
val -= sub_gram.sum() / (end - start) Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
deepcharles
May 12, 2023
Replies: 1 comment
-
Hi, sorry for the late reply. hope this is clear enough. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mhbl3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, sorry for the late reply.$k(y_{i}, y_{j})$ at the position $(i,j)$ .
You can refer to Remark 2 in this article and note that the Gram matrix contains the values of
hope this is clear enough.