-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_eigenvalue_I_networks.py
More file actions
45 lines (35 loc) · 936 Bytes
/
plot_eigenvalue_I_networks.py
File metadata and controls
45 lines (35 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
#
# plot_eigenvalue_I_networks.py
#
# Copyright 2017 Sebastian Spreizer
# The MIT License
import numpy as np
import pylab as pl
import lib.connection_matrix as cm
landscapes = [
{'mode': 'symmetric'},
{'mode': 'random'},
{'mode': 'Perlin', 'specs': {'size': 4}},
{'mode': 'Perlin_uniform', 'specs': {'size': 4}},
{'mode': 'homogeneous', 'specs': {'phi': 3}},
]
nrow, ncol = 100, 100
npop = nrow * ncol
ncon = 1000
kappa = 4 # shape
theta = 3 # scale
n = 1000
a = []
for idx, landscape in enumerate(landscapes):
W = cm.I_networks(landscape, nrow, ncol, ncon, kappa, theta)
a.append(W)
fig, ax = pl.subplots(1)
for idx, c in enumerate(a):
w, v = np.linalg.eig(-1. * c[:n, :n])
ax.plot(w.real, w.imag, 'o', label=landscapes[idx]['mode'])
ax.set_title('Eigenvalue')
ax.set_xlabel('Real part')
ax.set_ylabel('Imag part')
pl.legend()
pl.show()