From 75de14e7b3e9fea4f9ada32545ed11f24e664d1d Mon Sep 17 00:00:00 2001 From: brando90 Date: Fri, 12 Nov 2021 11:01:43 -0600 Subject: [PATCH 1/2] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 2928371..0882d7f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +## Install +``` +pip install -U git+https://github.com/google/svcca +``` + ## (SV)CCA for Representational Insights in Deep Neural Networks This repository contains code and [jupyter notebook tutorials](https://github.com/google/svcca/tree/master/tutorials) on results in the following papers, as well as suggested extensions and open problems. From 1c3a16ba21371b6e7afe036b7b9a2eda6cb62eda Mon Sep 17 00:00:00 2001 From: brando90 Date: Mon, 15 Nov 2021 12:34:45 -0600 Subject: [PATCH 2/2] fixed nans by computing a way to output sqrt of matrices using numpy instead of google's code --- cca_core.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cca_core.py b/cca_core.py index 00aaa50..a9b8297 100644 --- a/cca_core.py +++ b/cca_core.py @@ -148,8 +148,13 @@ def compute_ccas(sigma_xx, sigma_xy, sigma_yx, sigma_yy, epsilon, if verbose: print("taking square root") - invsqrt_xx = positivedef_matrix_sqrt(inv_xx) - invsqrt_yy = positivedef_matrix_sqrt(inv_yy) + # - gives NAN errors + # invsqrt_xx = positivedef_matrix_sqrt(inv_xx) + # invsqrt_yy = positivedef_matrix_sqrt(inv_yy) + import scipy + # print('npy\'s sqrt') + invsqrt_xx = scipy.linalg.sqrtm(inv_xx) + invsqrt_yy = scipy.linalg.sqrtm(inv_yy) if verbose: print("dot products...")