当前位置: 首页>>代码示例>>Python>>正文


Python Graphics.raster_plot方法代码示例

本文整理汇总了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_])
开发者ID:mac389,项目名称:deep-brain-stimulation,代码行数:33,代码来源:pain.py

示例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_])
开发者ID:mac389,项目名称:deep-brain-stimulation,代码行数:33,代码来源:basal-ganglia.py


注:本文中的Graphics.raster_plot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。