def style_loss5d(self, out_layer, target_style_layer):
# Each input is a 5D tensor: (style loss layer, batch, feature map, height, width)
return T.mean(T.sum(T.sqr(self.batched_gram(out_layer) - T.tile(self.batched_gram(target_style_layer), (1, T.shape(out_layer)[0], 1, 1))), axis=(2,3)), axis=1)
评论列表
文章目录