tensorflow / kfac

An implementation of KFAC for TensorFlow
Apache License 2.0
197 stars 41 forks source link

Is reusing linear layers the same as a convolutional layer #42

Open xmax1 opened 4 years ago

xmax1 commented 4 years ago

If we are reusing weights in a linear layer can we use the same approximation to compute the covariances, or are there some subtleties?

for example if weights w are used 4x we can compute \Omega as (1/(4M)) A A^T where M is the batch size

deriving from the definition of a fisher block and assuming spatially uncorrelated derivatives seems to land you in the same place as the convolutional approximation

james-martens commented 4 years ago

The type of approximation they use is the same one, essentially. However, you can't use them interchangeably in the code since convs involve special ops and also "reuse" the different patches of their input vectors.