MCPcopy Index your code
hub / github.com/modelscope/FunASR / reset_parameters

Method reset_parameters

funasr/models/lora/layers.py:295–301  ·  view source on GitHub ↗

Reset parameters.

(self)

Source from the content-addressed store, hash-verified

293 self.weight.data = self.weight.data.T
294
295 def reset_parameters(self):
296 """Reset parameters."""
297 nn.Linear.reset_parameters(self)
298 if hasattr(self, "lora_A"):
299 # initialize A the same way as the default for nn.Linear and B to zero
300 nn.init.kaiming_uniform_(self.lora_A, a=math.sqrt(5))
301 nn.init.zeros_(self.lora_B)
302
303 def zero_pad(self, x):
304 """Zero pad.

Callers 1

__init__Method · 0.95

Calls 1

reset_parametersMethod · 0.45

Tested by

no test coverage detected