deepq.py 文件源码

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

项目:ai-bs-summer17 作者: uchibe 项目源码 文件源码
def backupNetwork(self, model, backup):
        weightMatrix = []
        for layer in model.layers:
            weights = layer.get_weights()
            weightMatrix.append(weights)

        # np.save('weightMatrix.npy', weightMatrix)
        # print(weightMatrix.shape)
        i = 0
        for layer in backup.layers:
            weights = weightMatrix[i]
            layer.set_weights(weights)
            i += 1

    # def loadWeights(self,path):
    #     self.model.set_weights(load_model(path).get_weights())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号