Exemple #1
0
 def clique_locations(self, count, wVal):
     """Return the locations of cliques of a given size"""
     self.rewind()
     x = []
     y = []
     h = np.zeros(1 + self.patchSize, dtype=int)
     for k in range(self.numPatches):
         b = self.next_patch_bytes()
         if len(b) == self.patchSize:
             csize = self.clique_size(b, wVal)
             if csize == count:
                 nxg = self.nxGlobal
                 nyg = self.nyGlobal
                 nxb = self.nxprocs
                 nyb = self.nyprocs
                 kx = conv.kxBlockedPos(k, nxg, nyg, self.nf, nxb, nyb)
                 ky = conv.kyBlockedPos(k, nxg, nyg, self.nf, nxb, nyb)
                 x.append(kx)
                 y.append(ky)
     return np.array([x, y])
 def clique_locations(self, count, wVal):
    """Return the locations of cliques of a given size"""
    self.rewind()
    x = []
    y = []
    h = np.zeros(1 + self.patchSize, dtype=int)
    for k in range(self.numPatches):
       b = self.next_patch_bytes()
       if len(b) == self.patchSize:
          csize = self.clique_size(b, wVal)
          if csize == count:
             nxg = self.nxGlobal
             nyg = self.nyGlobal
             nxb = self.nxprocs
             nyb = self.nyprocs
             kx = conv.kxBlockedPos(k, nxg, nyg, self.nf, nxb, nyb)
             ky = conv.kyBlockedPos(k, nxg, nyg, self.nf, nxb, nyb)
             x.append(kx)
             y.append(ky)
    return np.array([x,y])
Exemple #3
0
   count = int(sys.argv[2])

if len(sys.argv) >= 4:
   w_split_val = int(sys.argv[3])

w = rw.PVReadWeights(sys.argv[1])

for k in range(w.numPatches):
   b = w.next_patch_bytes()
   csize = w.clique_size(b, count)
   if csize == count:
      nxg = w.nxGlobal
      nyg = w.nyGlobal
      nxb = w.nxprocs
      nyb = w.nyprocs
      kx = conv.kxBlockedPos(k, nxg, nyg, w.nf, nxb, nyb)
      ky = conv.kyBlockedPos(k, nxg, nyg, w.nf, nxb, nyb)

l = w.clique_locations(count, w_split_val)

print "number of neurons is ", len(l[0,:])
if len(l[0,:]) < 100: print l

fig = plt.figure()
ax = fig.add_subplot(111, axisbg='darkslategray')

ax.plot(l[0,:], l[1,:], 'o', color='y')

ax.set_xlabel('KX GLOBAL')
ax.set_ylabel('KY GLOBAL')
ax.set_title('Location of cliques of size ' + str(count))