test_pynnio.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码
def build_test_data(self, variable='v'):
        metadata = {
            'size': NCELLS,
            'first_index': 0,
            'first_id': 0,
            'n': 505,
            'variable': variable,
            'last_id': NCELLS - 1,
            'last_index': NCELLS - 1,
            'dt': 0.1,
            'label': "population0",
        }
        if variable == 'v':
            metadata['units'] = 'mV'
        elif variable == 'spikes':
            metadata['units'] = 'ms'
        data = np.empty((505, 2))
        for i in range(NCELLS):
            # signal
            data[i*101:(i+1)*101, 0] = np.arange(i, i+101, dtype=float)
            # index
            data[i*101:(i+1)*101, 1] = i*np.ones((101,), dtype=float)
        return data, metadata
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号