8000 [MRG] MNT: Use `fmax` when finding the maximum by jakirkham · Pull Request #12005 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] MNT: Use fmax when finding the maximum #12005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions sklearn/linear_model/cd_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,9 @@ def enet_coordinate_descent(floating[::1] w,

# update the maximum absolute coefficient update
d_w_ii = fabs(w[ii] - w_ii)
if d_w_ii > d_w_max:
d_w_max = d_w_ii
d_w_max = fmax(d_w_max, d_w_ii)

if fabs(w[ii]) > w_max:
w_max = fabs(w[ii])
w_max = fmax(w_max, fabs(w[ii]))

if (w_max == 0.0 or
d_w_max / w_max < d_w_tol or
Expand Down
0