-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGA_params.py
47 lines (33 loc) · 1.42 KB
/
GA_params.py
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
import numpy as np
class GA_params:
def __init__( self ):
minParamValues = list()
maxParamValues = list()
# Additional stimulations
# [ Th, GPe, GPi ]
#Leave e-3 term to the moment of phenotype mapping to ensure genotype range is the same for all params=
minParamValues += list( np.array([1.2, 3., 3.]) * 1e-3 * (1 - 0.5) )
maxParamValues += list( np.array([1.2, 3., 3.]) * 1e-3 * (1 + 0.5) )
# Conductances
# [ gkcabar, gahp ]
minParamValues += list( np.array([5., 10.]) * 1e-3 * (1 - 0.5) )
maxParamValues += list( np.array([5., 10.]) * 1e-3 * (1 + 0.5) )
# Conductances modulator from cortex to str
# multiplies gcostr and gsyn
minParamValues += [0.8]
maxParamValues += [1.2]
# Number of cells in each region
minParamValues += [10.]*8
maxParamValues += [30.]*8
self.minParamValues = np.array( minParamValues )
self.maxParamValues = np.array( maxParamValues )
def transform( self, cand ):
cand = np.array( cand )
cand = cand * ( self.maxParamValues - self.minParamValues )
cand = cand + self.minParamValues
return list( cand )
def inv_transform( self, cand ):
cand = np.array( cand )
cand = cand - self.minParamValues
cand = cand / ( self.maxParamValues - self.minParamValues )
return list( cand )