Skip to content

Instantly share code, notes, and snippets.


Albin Severinson severinson

View GitHub Profile
severinson / PCAGD.jl
Created Sep 6, 2020
PCA via gradient sketching
View PCAGD.jl
using Random
using LinearAlgebra
using LowRankApprox
"""Orthogonalize and normalize the columns of A in-place."""
function orthogonal!(A)
m, n = size(A)
@inbounds for i in 1:n
@inbounds for j in 1:i-1
view(A, :, i) .-= dot(view(A, :, j), view(A, :, i)) .* view(A, :, j)