Skip to content

Commit

Permalink
Merge pull request #12 from brianhie/bias_error
Browse files Browse the repository at this point in the history
chore: different bias addition
  • Loading branch information
Zymrael authored Feb 18, 2024
2 parents 37caf4d + 30a95f8 commit 92a91cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ def parallel_fir(
z_pre = fir_fn(
u,
weight,
bias,
bias=None, # don't pass it here, add manually instead! source of small error
stride=1,
padding=fir_length - 1,
groups=u.shape[1],
)[..., :L]

# add manually instead! source of small error
z_pre = z_pre + bias[None, :, None]

# handle padding post fir, the only place with biases
if type(padding_mask) == torch.Tensor:
z_pre = z_pre * padding_mask[:, None]
Expand Down

0 comments on commit 92a91cd

Please sign in to comment.