Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 7 additions & 2 deletions cca_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand Down