本文整理汇总了Python中Graphics.raster_plot方法的典型用法代码示例。如果您正苦于以下问题:Python Graphics.raster_plot方法的具体用法?Python Graphics.raster_plot怎么用?Python Graphics.raster_plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics.raster_plot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sgn
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import raster_plot [as 别名]
v[:,t] += stimulation_pattern[:,t] + afferent_activation_pattern[:,t]
v[:,t] = sgn(v[:,t])
#---Debugging
if debugging:
print '------------'
print 'Unit %d selected, corresponding to %s'%(idx[t],area[idx[t]])
print 'Kernel: ',M[:,idx[t]]
print 'Network activity: ', v[:,t-1]
print 'Stimulation pattern: ', stimulation_pattern[idx[t],t]
print 'Total input %.02f'%I[5]
print 'Probability: %.02f, threshold:%.02f'%(F(I[idx[t]]),threshold[t])
print 'Acitvity %d -> %d'%(v[idx[t],t-1],v[idx[t],t])
print '--------'
#---
'''
with open('pain-v.tsv','wb') as f:
writer = csv.writer(f)
for row_title,data_row in zip(area_names,v.T):
writer.writerow([row_title] + data_row.tolist())
'''
np.savetxt('pain-v-spine-spare.tsv',v,fmt='%.04f',delimiter='\t', header='\t'.join(area_names), comments='')
artist.raster_plot(v,filename='../results/pain',duration=[params['duration']['interpattern' if 'interpattern' in condition else 'pattern'] for condition in pattern_],
parasite_labels=[condition if 'interpattern' not in condition else '' for condition in pattern_],
axes_labels = area_names)
artist.firing_rate_plot(v,filename='../results/pain_rate',duration=[params['duration']['interpattern' if 'interpattern' in condition else 'pattern'] for condition in pattern_],
parasite_labels=[condition if 'interpattern' not in condition else '' for condition in pattern_])
示例2: range
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import raster_plot [as 别名]
F = lambda current: 1./(1+np.exp(-current))
debugging=False
for t in range(1,total_duration):
# Determine the state of unit idx[t] at time t
I = afferent_activation_pattern[:,t]#*v[:,t] # Afferent activation
I[idx[t]] += M[:,idx[t]].dot(v[:,t-1])+stimulation_pattern[idx[t],t] #Target inhibition
#Stochastically update the state of unit idx[t]
v[idx[t],t] = 1 if F(I[idx[t]]) > threshold[t] else -1
v[:,t] += stimulation_pattern[:,t] + afferent_activation_pattern[:,t]
v[:,t] = sgn(v[:,t])
#---Debugging
if debugging:
print '------------'
print 'Unit %d selected, corresponding to %s'%(idx[t],area[idx[t]])
print 'Kernel: ',M[:,idx[t]]
print 'Network activity: ', v[:,t-1]
print 'Stimulation pattern: ', stimulation_pattern[idx[t],t]
print 'Total input %.02f'%I[5]
print 'Probability: %.02f, threshold:%.02f'%(F(I[idx[t]]),threshold[t])
print 'Acitvity %d -> %d'%(v[idx[t],t-1],v[idx[t],t])
print '--------'
#---
artist.raster_plot(v,duration=[params['duration']['interpattern' if 'interpattern' in condition else 'pattern'] for condition in pattern_])
# parasite_labels=[condition if 'interpattern' not in condition else '' for condition in pattern_])
artist.firing_rate_plot(v,duration=[params['duration']['interpattern' if 'interpattern' in condition else 'pattern'] for condition in pattern_],
parasite_labels=[condition if 'interpattern' not in condition else '' for condition in pattern_])