nettrainer.py 文件源码

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

项目:deep-prior 作者: moberweger 项目源码 文件源码
def replaceTrainingData(self, start_idx, end_idx, last=False):
        """
        Replace the shared data of the training data
        :param start_idx: start index of data
        :param end_idx: end index of data
        :param last: specify if it is last macro-batch
        :return: None
        """

        for var in self.managedVar:
            if not hasattr(self, var):
                raise ValueError("Variable " + var + " not defined!")
            if last is True:
                getattr(self, var).set_value(getattr(self, var+'DBlast')[start_idx:end_idx], borrow=True)
            else:
                getattr(self, var).set_value(getattr(self, var+'DB')[start_idx:end_idx], borrow=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号