Esempio n. 1
0
def memberVarience(population, alpha):
    diffSum = 0.0
    for member in population:
        mg = Network.vectorizeMatrix(member.genome)
        ag = Network.vectorizeMatrix(alpha.genome)
        diffSum = diffSum + Network.outputError(mg, ag)
    return diffSum / len(population)
Esempio n. 2
0
def avgSigma(population):
    sigSum = 0.0
    sigCount = 0
    for member in population:
        ms = Network.vectorizeMatrix(member.sigmas)
        for singleSigma in ms:
            sigSum = sigSum + singleSigma
            sigCount = sigCount + 1
    return sigSum / sigCount