python类gram_matrix()的实例源码

EvaluationModel.py 文件源码 项目:A-Neural-Algorithm-of-Artistic-Style 作者: kbedi95 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def style_gram_matrices(self):

        gram_matrices = []

        for style_layer in config["style_layers"]:

            # Get the activations of the given style image at the given style layer
            style_activation = utils.get_layer_activations(session=self.evaluation_sess, graph=self.evaluation_g,
                                                           layer_name=style_layer, input_layer_name=self.input_tensor,
                                                           input=self.style_image)

            # Construct the gram matrix from the activations and save the matrix to the gram_matrices array
            gram_matrices.append(utils.gram_matrix(style_activation).astype(np.float32))

        return gram_matrices


问题


面经


文章

微信
公众号

扫码关注公众号