MCPcopy Create free account
hub / github.com/AtlasAnalyticsLab/AdaFisher / linear

Method linear

optimizers/kfac_utils.py:171–179  ·  view source on GitHub ↗
(g, layer, batch_averaged)

Source from the content-addressed store, hash-verified

169
170 @staticmethod
171 def linear(g, layer, batch_averaged):
172 # g: batch_size * out_dim
173 batch_size = g.size(0)
174
175 if batch_averaged:
176 cov_g = g.t() @ (g * batch_size)
177 else:
178 cov_g = g.t() @ (g / batch_size)
179 return cov_g

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected