Skip to content

Commit

Permalink
Pinv instead of Inv WLS.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuellujan committed Jul 12, 2024
1 parent 32c23ff commit 25cc387
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Learning/linear-learn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function learn!(

# Calculate coefficients β.
Q = Diagonal(ws[1] * ones(length(e_train)))
βs = (A'*Q*A) \ (A'*Q*b)
βs = pinv(A'*Q*A)*(A'*Q*b)

# Update lp.
if int
Expand Down Expand Up @@ -238,7 +238,7 @@ function learn!(
# Calculate coefficients βs.
Q = Diagonal([ws[1] * ones(length(e_train));
ws[2] * ones(length(f_train))])
βs = (A'*Q*A) \ (A'*Q*b)
βs = pinv(A'*Q*A)*(A'*Q*b)

# Update lp.
if int
Expand Down

0 comments on commit 25cc387

Please sign in to comment.