Esempio n. 1
0
def printCentImage(layer, cent):
    l = pd.GetCentroidImageWidth(network.getNetwork(), layer)
    l = l * l
    channel = 0
    fa = pd.SWIG_FloatArray_frompointer(network.getCentroidImage(channel, layer, cent))
    for i in xrange(l):
        print fa[i]
Esempio n. 2
0
def printStats():
    n = dn.getNode(7,0,0)
    print "Winner: %i" %(n.winner)
    starv =  pd.SWIG_FloatArray_frompointer( n.starv )
    for c in range(n.nb):
        print "starv %i: %f" % (c, starv[c])
        
    print ""
Esempio n. 3
0
def printStats():
    """ Prints the winning centriod index and starvation trace for the top node."""
    n = top_node()
    print "Winner: %i" % (n.winner)
    starv = pd.SWIG_FloatArray_frompointer(n.starv)
    for c in xrange(n.nb):
        print "starv %i: %f" % (c, starv[c])

    print ""
Esempio n. 4
0
def freezeTopCentroidsExcept(lucky_centroid):
    if lucky_centroid == None:
        return
    starv = pd.SWIG_FloatArray_frompointer(top_node().starv)
    small = 1e-6
    for c in xrange(top_node().nb):
        starv[c] = 1

    starv[lucky_centroid] = small
Esempio n. 5
0
def printCentImage(layer, cent):
    l = pd.GetCentroidImageWidth(dn.getNetwork(), layer)
    l = l * l
    fa = pd.SWIG_FloatArray_frompointer( dn.getCentroidImage(layer, cent))
    for i in range(l):
        print fa[i]