fmri.py 文件源码

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

项目:modl 作者: arthurmensch 项目源码 文件源码
def __call__(self, masker, dict_fact, cpu_time, io_time):
        test_time = time.perf_counter()
        if not hasattr(self, 'data'):
            self.data = masker.transform(self.test_imgs,
                                         confounds=self.test_confounds)
        scores = np.array([dict_fact.score(data) for data in self.data])
        len_imgs = np.array([data.shape[0] for data in self.data])
        score = np.sum(scores * len_imgs) / np.sum(len_imgs)
        self.test_time += time.perf_counter() - test_time
        this_time = time.perf_counter() - self.start_time - self.test_time
        self.score.append(score)
        self.time.append(this_time)
        self.cpu_time.append(cpu_time)
        self.io_time.append(io_time)
        self.iter.append(dict_fact.n_iter_)
        if self.info is not None:
            self.info['time'] = self.cpu_time
            self.info['score'] = self.score
            self.info['iter'] = self.iter
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号