using LinearAlgebra | |
using Random | |
function circuit_complexity(N) | |
radii = zeros(1,N); | |
for i=1:N | |
sum_of_radii = 0.0 | |
## the input signal | |
X = rand(3,1)*2 .-1.0 | |
W= rand(3,3)*sqrt(2/3) | |
## the main calculation | |
for j=1:100 | |
sum_of_radii += norm(W^i*X-X) | |
end | |
radii[i] = sum_of_radii/100 | |
end | |
return radii | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment