Skip to content

Dimension of the NTK kernel #161

Answered by romanngg
yidiq7 asked this question in Q&A
Aug 17, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Note that kernel_fn computes (infinite limit of) the expectation of outputs (nngp) or Jacobians (ntk) covariance. But both outputs and Jacobians are i.i.d. along the output channel_axis (of size 2 in your example), hence the k|D| * k|D| covariance is constant-block diagonal along the pair of k dimensions, and the full covariance is the Kronecker product of the kernel and the identity matrix kernel_{|D| * |D|} \otimes I_{k * k}. For this reason we only compute the non-trivial and replicated |D| * |D| kernel block.

Non-i.i.d. dimensions are preserved, so if e.g. your NN outputs CNN outputs of size |D|, H, k, the output kernel will have shape |D|, |D|, H, H, (note that pairs of dimensions ar…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yidiq7
Comment options

@romanngg
Comment options

Answer selected by yidiq7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants