Skip to content

Commit

Permalink
Update lib/scholar/covariance/shrunk_covariance.ex
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Sluszniak <[email protected]>
  • Loading branch information
norm4nn and msluszniak authored Nov 11, 2024
1 parent df80bc3 commit 4ec5bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scholar/covariance/shrunk_covariance.ex
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ defmodule Scholar.Covariance.ShrunkCovariance do
mask = Nx.iota(Nx.shape(shrunk_cov))
selector = Nx.remainder(mask, num_features + 1) == 0

Nx.select(selector, shrunk_cov + shrinkage * mu, shrunk_cov)
shrunk_cov + shrinkage * mu * selector
end
end

0 comments on commit 4ec5bc5

Please sign in to comment.