From 25cc3871e44563a9a30f32d8bff7d66cbc69f54e Mon Sep 17 00:00:00 2001 From: Emmanuel Lujan Date: Fri, 12 Jul 2024 18:37:53 -0400 Subject: [PATCH] Pinv instead of Inv WLS. --- src/Learning/linear-learn.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Learning/linear-learn.jl b/src/Learning/linear-learn.jl index a02c4c38..984c97fc 100644 --- a/src/Learning/linear-learn.jl +++ b/src/Learning/linear-learn.jl @@ -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 @@ -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