原书出处
Build a Reasoning Model (From Scratch)
self.d_out = num_heads * head_dim self.W_query = nn.Linear( d_in, self.d_out, bias=False, dtype=dtype ) self.W_key = nn.Linear( d_in, num_kv_groups * head_dim, bias=False,dtype=dtype ) self.W_value = nn.Linear( d_in, num_kv_groups * head_dim, bias=False, dtype=dtype ) self.out_proj = nn.Linear(self.d_out, d_in, bias=False, dtype=dtype) if qk_norm: self.q_norm = RMSNorm(head_dim, eps=1e-6) self.k_norm = RMSNorm(head_dim, eps=1e-6) else: self.q_norm = self.k_norm = None
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Build a Reasoning Model (From Scratch)/_epub-src/OEBPS/Text/appendix-c.html
EPUB SHA-256:52d4d07986020be70f5aac21762dfcf60fcba08db0ba29d4f63957caf12aa377