Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit e0d79c2

Browse files
committed
Fix derivative wrt regularization term in linear term
1 parent 3aae36d commit e0d79c2

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

polylearn/cd_linear_fast.cpp

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polylearn/cd_linear_fast.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ cpdef double _cd_linear_epoch(np.ndarray[double, ndim=1] w,
3939
for ii in range(n_nz):
4040
i = indices[ii]
4141
update += loss.dloss(y_pred[i], y[i]) * data[ii]
42-
update += 2 * alpha * w[j]
42+
update += alpha * w[j]
4343

4444
# compute second derivative upper bound
45-
inv_step_size = loss.mu * col_norm_sq[j] + 2 * alpha
45+
inv_step_size = loss.mu * col_norm_sq[j] + alpha
4646
update /= inv_step_size
4747

4848
w[j] -= update

0 commit comments

Comments
 (0)