From 2ee2f167810ed3d6eb61ddac6db60576fb36c1c3 Mon Sep 17 00:00:00 2001 From: Marco-Congedo Date: Wed, 18 Mar 2020 10:47:37 +0100 Subject: [PATCH 1/2] fixed bug on `cca` function --- Project.toml | 2 +- docs/Project.toml | 2 +- src/cca.jl | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 4ef14c6..bf440ae 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Diagonalizations" uuid = "9cd687f3-b62d-43f3-8fd3-ffcd9e581047" authors = ["Marco-Congedo "] -version = "0.1.9" +version = "0.1.10" [deps] CovarianceEstimation = "587fd27a-f159-11e8-2dae-1979310e6154" diff --git a/docs/Project.toml b/docs/Project.toml index 3e9d65c..6e520f4 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,5 @@ authors = ["Marco-Congedo "] -version = "0.1.9" +version = "0.1.10" [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" diff --git a/src/cca.jl b/src/cca.jl index 1255392..20c9849 100644 --- a/src/cca.jl +++ b/src/cca.jl @@ -516,9 +516,9 @@ function cca(Cx :: SorH, Cy :: SorH, Cxy :: Mat; kwargs=(eVarMeth=eVarMeth, simple=true); e=eVar - x=whitening(Cx; eVar=eVarCx, kwargs...) - y=whitening(Cy; eVar=eVarCy, kwargs...) - m=mca(x.F'*Cxy*y.F; eVar=e, kwargs...) + x=whitening(Cx; eVar=eVarCx, eVarMeth=eVarMeth) + y=whitening(Cy; eVar=eVarCy, eVarMeth=eVarMeth) + m=mca(x.F'*Cxy*y.F; eVar=e, eVarMeth=eVarMeth) if simple LF([x.F*m.F[1], y.F*m.F[2]], [m.iF[1]*x.iF, m.iF[2]*y.iF], m.D, ○, ○, ○, args...) From 00c253c4aca543947e16f708e102b57bf906e5dc Mon Sep 17 00:00:00 2001 From: Marco-Congedo Date: Wed, 18 Mar 2020 10:50:21 +0100 Subject: [PATCH 2/2] cleaned up code --- src/cca.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cca.jl b/src/cca.jl index 20c9849..e9ac589 100644 --- a/src/cca.jl +++ b/src/cca.jl @@ -513,17 +513,15 @@ function cca(Cx :: SorH, Cy :: SorH, Cxy :: Mat; size(Cy, 2)==size(Cxy, 2) || throw(ArgumentError(📌*", cca function: Matrices `Cy` and `Cxy` must have the same number of rows")) args=("Canonical Correlation Analysis", false) - kwargs=(eVarMeth=eVarMeth, simple=true); - e=eVar x=whitening(Cx; eVar=eVarCx, eVarMeth=eVarMeth) y=whitening(Cy; eVar=eVarCy, eVarMeth=eVarMeth) - m=mca(x.F'*Cxy*y.F; eVar=e, eVarMeth=eVarMeth) + m=mca(x.F'*Cxy*y.F; eVar=eVar, eVarMeth=eVarMeth) if simple LF([x.F*m.F[1], y.F*m.F[2]], [m.iF[1]*x.iF, m.iF[2]*y.iF], m.D, ○, ○, ○, args...) else - e, D, U, V, p, arev=_ssdxy!(e, diag(m.D), m.F[1], m.F[2], _minDim(Cxy), eVarMeth) + e, D, U, V, p, arev=_ssdxy!(eVar, diag(m.D), m.F[1], m.F[2], _minDim(Cxy), eVarMeth) LF([x.F*U, y.F*V], [U'*x.iF, V'*y.iF], D, e, diag(m.D), arev, args...) end end