Documentation
¶
Index ¶
- Constants
- Variables
- func AddNoise2CueFlip(cue_out, cue Cue, eta float64)
- func AddNoise2CueNormal(cue_out, cue Cue, eta float64)
- func AddVecs(vout, v0, v1 Vec)
- func CheckCPD(ten Tensor3, cpd []ElemsCPD) (float64, float64)
- func CopyDmat(mat1, mat0 Dmat)
- func CrossoverSpmats(mat0, mat1 Spmat)
- func DOT_Genealogy(genfilename, popfilename string, ngen, npop int)
- func DeepVec2Test(v1, v2 [][]float64) float64
- func DeepVec3NovTest(v [][]float64, vv [][][]float64) error
- func DiffGenomes(Gout, G1, G0 *Genome)
- func DiffVecs(vout, v0, v1 Vec)
- func Dist2Vecs(v0, v1 Vec) float64
- func DistVecs(v0, v1 Vec) float64
- func DistVecs1(v0, v1 Vec) float64
- func DotSpmats(mat0, mat1 Spmat) float64
- func DotVecs(v0, v1 Vec) float64
- func GetCrossCov(vecs0, vecs1 []Vec, submean0, submean1 bool) (Vec, Vec, Dmat)
- func GetCrossCov3(vecs0, vecs1, vecs2 []Vec, submean0, submean1, submean2 bool) (Vec, Vec, Vec, Tensor3)
- func GetCueVar(cues Cues) float64
- func GetMaxPop() int
- func GetNcells() int
- func GetNenv() int
- func GetNsel() int
- func GetSVD(ccmat Dmat) (*mat.Dense, []float64, *mat.Dense)
- func GetSVD_opt(ccmat Dmat, flag mat.SVDKind) (*mat.Dense, []float64, *mat.Dense)
- func Hammingdist(v0, v1 Vec) float64
- func Mate(dad, mom *Indiv) (Indiv, Indiv)
- func MinInt(x, y int) int
- func MultMatVec(vout Vec, mat Spmat, vin Vec)
- func MultMatVec_T(vout Vec, mat Spmat, vin Vec)
- func Norm2(v Vec) float64
- func Norm2Sq(v Vec) float64
- func NormalizeVec(v Vec)
- func ProjectSVD(label string, dirE, dirP *mat.VecDense, data0, data1 Dmat, mean0, mean1 Vec, ...)
- func RandomInit(a Dmat, maxcol int)
- func ResetDmat(mat Dmat)
- func ScaleVec(vout Vec, s float64, vin Vec)
- func SetParams(s Settings)
- func SetSeed(seed int64)
- func SetSeedCue(seed int64)
- func SumVec(v Vec) float64
- func TestEqualGenomes(G0, G1 Genome) float64
- func TestEqualPopGenomes(pop0, pop1 Population) float64
- func WAddVecs(vout Vec, sca float64, v0, v1 Vec)
- type Body
- type CPDArray
- type Cell
- type CoreTensor3
- type Cue
- type Cues
- type Dmat
- type ElemsCPD
- type Genome
- type Indiv
- type PopStats
- type Population
- func (pop *Population) ChangeEnvs(denv int)
- func (pop *Population) ClearGenome()
- func (pop *Population) Copy() Population
- func (pop *Population) DevPop(gen int) Population
- func (pop0 *Population) Evolve(test bool, ftraj *os.File, jsonout string, nstep, epoch int) Population
- func (pop *Population) ExportPopGz(filename string)
- func (pop *Population) GetFlatGenome(IEnv int) Dmat
- func (pop *Population) GetFlatStateVec(istate string, ienv, ibeg, iend int) Dmat
- func (pop *Population) GetMeanPhenotype(gen int) Cues
- func (pop *Population) GetStats() PopStats
- func (pop *Population) ImportPopGz(filename string)
- func (pop *Population) PairReproduce(nNewPop int) Population
- func (pop *Population) RandomizeGenome()
- func (pop *Population) Reproduce(nNewPop int) Population
- func (pop *Population) Selection(nNewPop int) []Indiv
- func (pop *Population) SetRandomNovEnvs()
- func (pop *Population) SetWagnerFitness()
- func (pop *Population) SortPopIndivs()
- type Settings
- type Spmat
- type Tensor3
- type Vec
Constants ¶
View Source
const ( IAncEnv = iota // Previous env INovEnv // Current env NBodies )
View Source
const ( CellE = iota CellF CellG CellH CellP )
Variables ¶
View Source
var DensityE float64 = defaultDensity
View Source
var DensityF float64 = defaultDensity
View Source
var DensityG float64 = defaultDensity
View Source
var DensityH float64 = defaultDensity
View Source
var DensityJ float64 = defaultDensity
View Source
var DensityP float64 = defaultDensity
Functions ¶
func AddNoise2CueFlip ¶
func AddNoise2CueNormal ¶
func CrossoverSpmats ¶
func CrossoverSpmats(mat0, mat1 Spmat)
func DOT_Genealogy ¶
Dumps genealogy of population for an epoch into a dot file, going backwards in time. Returns number of reproducing population
func DeepVec2Test ¶
func DeepVec3NovTest ¶
func DiffGenomes ¶
func DiffGenomes(Gout, G1, G0 *Genome)
func GetCrossCov3 ¶
func GetSVD_opt ¶
expect flag = mat.SVDThin or mat.SVDThinU
func Hammingdist ¶
func MultMatVec ¶
func MultMatVec_T ¶
func NormalizeVec ¶
func NormalizeVec(v Vec)
func ProjectSVD ¶
func RandomInit ¶
func SetSeedCue ¶
func SetSeedCue(seed int64)
func TestEqualGenomes ¶
func TestEqualPopGenomes ¶
func TestEqualPopGenomes(pop0, pop1 Population) float64
Types ¶
type Body ¶
type Cell ¶
type CoreTensor3 ¶
type CoreTensor3 []elem_tensor3
func GetFastHOSVD ¶
Interlaced Computation; supposed to be significantly faster. Should be len0 <= len1 <= len2
type Cue ¶
type Cue = Vec //Environment cue is a special kind of vector
type Dmat ¶
type Dmat = []Vec
func FlattenTensor3 ¶
func KR_Product ¶
The Khatri-Rao Product between KxN and KxN matrices
type Genome ¶
type Genome struct { E Spmat //Environment cue effect on epigenome F Spmat //Regulatory effect of epigenetic markers on gene expression G Spmat //Regulatory effect of gene expression on epigenetic markers H Spmat //Contribution of gene expression on higher order complexes J Spmat //Interaction between higher order complexes P Spmat //Resulting expressed phenotype }
func (*Genome) NormalizeGenome ¶
type Indiv ¶
type Indiv struct { Id int DadId int MomId int Bodies []Body //IAncEnv, INovEnv (see above const.) Fit float64 //Fitness with cues WagFit float64 //Wagner relative fitness Plasticity float64 //Observed Plasticity Dp1e1 float64 // ||p(e1) - e1|| Dp0e0 float64 // ||p(e0) - e0|| Dp1e0 float64 // ||p(e1) - e0|| Dp0e1 float64 // ||p(e0) - e1|| }
type PopStats ¶
type PopStats struct { PEDot float64 // (delta P, delta E) dot product PErr1 float64 // <|| p(e1) - e1 ||> (Nov) PErr0 float64 // <|| p(e0) - e0 ||> (Anc) PED10 float64 // <|| p(e1) - e0 ||> (Nov-Anc) PED01 float64 // <|| p(e0) - e1 ||> (Anc-Nov) WagFit float64 Fitness float64 Plasticity float64 Div float64 NDevStep float64 }
type Population ¶
type Population struct { Params Settings Gen int NovEnvs Cues //Novel Environment AncEnvs Cues // Ancestral Environment Indivs []Indiv }
func NewPopulation ¶
func NewPopulation(s Settings) Population
func (*Population) ChangeEnvs ¶
func (pop *Population) ChangeEnvs(denv int)
func (*Population) ClearGenome ¶
func (pop *Population) ClearGenome()
func (*Population) Copy ¶
func (pop *Population) Copy() Population
func (*Population) DevPop ¶
func (pop *Population) DevPop(gen int) Population
func (*Population) Evolve ¶
func (pop0 *Population) Evolve(test bool, ftraj *os.File, jsonout string, nstep, epoch int) Population
Records population trajectory and writes files
func (*Population) ExportPopGz ¶
func (pop *Population) ExportPopGz(filename string)
func (*Population) GetFlatGenome ¶
func (pop *Population) GetFlatGenome(IEnv int) Dmat
func (*Population) GetFlatStateVec ¶
func (pop *Population) GetFlatStateVec(istate string, ienv, ibeg, iend int) Dmat
func (*Population) GetMeanPhenotype ¶
func (pop *Population) GetMeanPhenotype(gen int) Cues
func (*Population) GetStats ¶
func (pop *Population) GetStats() PopStats
func (*Population) ImportPopGz ¶
func (pop *Population) ImportPopGz(filename string)
func (*Population) PairReproduce ¶
func (pop *Population) PairReproduce(nNewPop int) Population
func (*Population) RandomizeGenome ¶
func (pop *Population) RandomizeGenome()
func (*Population) Reproduce ¶
func (pop *Population) Reproduce(nNewPop int) Population
func (*Population) Selection ¶
func (pop *Population) Selection(nNewPop int) []Indiv
func (*Population) SetRandomNovEnvs ¶
func (pop *Population) SetRandomNovEnvs()
func (*Population) SetWagnerFitness ¶
func (pop *Population) SetWagnerFitness()
func (*Population) SortPopIndivs ¶
func (pop *Population) SortPopIndivs()
type Settings ¶
type Settings struct { MaxPop int // Maximum number of individuals in population MaxDevStep int // Maximum steps for development. NGenes int NEnv int NSel int NCells int // Number of cell types WithCue bool // With cue? FLayer bool // f present? HLayer bool // h present? JLayer bool // J present? Pfback bool // P feedback to E layer SDNoise float64 // probability (or stdev) of environmental noise MutRate float64 // mutation rate TauF float64 TauG float64 TauH float64 DensityE float64 DensityF float64 DensityG float64 DensityH float64 DensityJ float64 DensityP float64 }
func CurrentSettings ¶
func CurrentSettings() Settings
type Spmat ¶
type Tensor3 ¶
type Tensor3 []Dmat
func NewTensor3 ¶
Click to show internal directories.
Click to hide internal directories.