卷积核可视化
import matplotlib.pyplot as plt
import numpy as np
from keras import backend as K
from keras.models import load_model
# 将浮点图像转换成有效图像
def deprocess_image(x):
# 对张量进行规范化
x -= x.mean()
x /= (x.std() + 1e-5)
x *= 0.1
x += 0.5
x = np.clip(x, 0, 1)
# 转化到RGB数组
x *= 255
x = np.clip(x, 0, 25
1