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

Method reset_parameters

funasr/models/lora/layers.py:171–177  ·  view source on GitHub ↗

Reset parameters.

(self)

Source from the content-addressed store, hash-verified

169 self.weight.data = self.weight.data.T
170
171 def reset_parameters(self):
172 """Reset parameters."""
173 nn.Linear.reset_parameters(self)
174 if hasattr(self, "lora_A"):
175 # initialize A the same way as the default for nn.Linear and B to zero
176 nn.init.kaiming_uniform_(self.lora_A, a=math.sqrt(5))
177 nn.init.zeros_(self.lora_B)
178
179 def train(self, mode: bool = True):
180 """Train.

Callers 8

__init__Method · 0.95
initializeFunction · 0.45
reset_parametersMethod · 0.45
reset_parametersMethod · 0.45
reset_parametersMethod · 0.45
to_pytorch_netMethod · 0.45
to_pytorch_netMethod · 0.45
to_pytorch_netMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected