def afterPG_1(self, cc): act = self.getORNs(cc) mu = misc.mean(act) for i in range(len(act)): act[i] -= mu if act[i] < 0: act[i] = 0 return act
def show_weights(self, excit): if len(weights) == 0 or self.__show_freqs: return self.__show_weights = True self.__excit = excit w = {} for isec in range(len(self.apic)): w.update({ (1, 0, isec):[0] }) for ituft in range(len(self.tuft)): for isec in range(len(self.tuft[ituft])): w.update({ (0, ituft, isec):[0] }) for gid in bindict.mgid_dict[self.mgid]: if gid >= syn_gid_begin and gid % 2 == 0: isec, x = bindict.gid_dict[gid][1:3] if x >= 1: iseg = len(self.dend[isec])-1 else: iseg = int(x*len(self.dend[isec])) if not excit: gid-=1 try: wsym = weights[gid] try: w[(2, isec, iseg)].append(wsym) except KeyError: w.update({(2, isec, iseg):[wsym]}) except KeyError: print 'gid %d not found' % gid if excit: max_steps = 0. + 2 * binspikes.sighalf_excit else: max_steps = 0. + 2 * binspikes.sighalf_inhib for k, ws in w.items(): if self.weights_max: _w = max(ws) else: _w = mean(ws) w[k] = int(_w/max_steps*(len(palette)-1)) self.__set_segment(w)