MCPcopy Create free account
hub / github.com/apple/axlearn / __init__

Method __init__

axlearn/common/lora.py:287–311  ·  view source on GitHub ↗
(self, cfg: Config, *, parent: Module)

Source from the content-addressed store, hash-verified

285 )
286
287 def __init__(self, cfg: Config, *, parent: Module):
288 super().__init__(cfg, parent=parent)
289 cfg = self.config
290 self._add_child(
291 "lora_down",
292 cfg.lora_down.set(
293 model_dim=cfg.rank,
294 num_heads=cfg.num_heads,
295 per_head_dim=self._per_head_dim,
296 bias=False,
297 ),
298 )
299 self._add_child(
300 "lora_up",
301 cfg.lora_up.set(
302 input_dim=cfg.rank,
303 output_dim=cfg.output_dim,
304 bias=False,
305 param_init=DefaultInitializer.default_config().set(
306 init_by_param_name={
307 PARAM_REGEXP_WEIGHT: ConstantInitializer.default_config().set(value=0.0)
308 }
309 ),
310 ),
311 )
312
313
314class LoraFusedQKVAdapter(_BaseLoraAdapter):

Callers

nothing calls this directly

Calls 4

_add_childMethod · 0.80
__init__Method · 0.45
setMethod · 0.45
default_configMethod · 0.45

Tested by

no test coverage detected