simulate.py 文件源码

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

项目:GraphTime 作者: GlooperLabs 项目源码 文件源码
def _graph_indices(T, changepoints):
        """Describes which graphs are active for each time
        by returning a list with the graphs indices

        Parameters
        ----------
        T : int
            number of total timesteps
        changepoints : list[int]
            list of changepoint indices

        Yields
        ------
        Graph indices for all t < T
        """
        graph = count = 0
        for cp in changepoints:
            while count < cp:
                count += 1
                yield graph
            graph += 1
        while count < T:
            count += 1
            yield graph
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号