network.py 文件源码

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

项目:sesame-paste-noodle 作者: aissehust 项目源码 文件源码
def load(self, istream):
        """
        Load the model from input stream.
        reset() is called to clean up network instance.
        """
        self.reset()

        allLayer = {}
        for layer in yaml.load_all(istream):
            allLayer[layer.saveName] = layer
            if issubclass(type(layer), RawInput):
                self.setInput(layer, reload=True)

        # TODO: consider there are multiple input layer
        # TODO: branch and merge
        shouldStop = False
        currentLayer = self.currentLayer
        while not shouldStop:
            self.append(allLayer[currentLayer.outputLayerName[0]], reload=True)
            currentLayer = allLayer[currentLayer.outputLayerName[0]]

            if len(currentLayer.outputLayerName) <= 0:
                shouldStop = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号