Fix RBF time-bias initialization
This commit is contained in:
@@ -111,7 +111,10 @@ class TemporalAttention(nn.Module):
|
||||
|
||||
# Layer-specific projection from shared RBF basis activations to per-head attention bias.
|
||||
self.rbf_proj = nn.Linear(n_rbf_bases, n_head, bias=False)
|
||||
self.time_bias_scale = nn.Parameter(torch.tensor(0.0))
|
||||
# Keep the initial RBF attention bias exactly zero through the
|
||||
# zero-initialized projection, while leaving that projection with a
|
||||
# live gradient from the first optimization step.
|
||||
self.time_bias_scale = nn.Parameter(torch.tensor(1.0))
|
||||
|
||||
self.resid_drop = nn.Dropout(dropout)
|
||||
self.reset_parameters()
|
||||
|
||||
Reference in New Issue
Block a user