2020
10-08
10-08
keras CNN卷积核可视化,热度图教程
卷积核可视化importmatplotlib.pyplotaspltimportnumpyasnpfromkerasimportbackendasKfromkeras.modelsimportload_model#将浮点图像转换成有效图像defdeprocess_image(x):#对张量进行规范化x-=x.mean()x/=(x.std()+1e-5)x*=0.1x+=0.5x=np.clip(x,0,1)#转化到RGB数组x*=255x=np.clip(x,0,255).astype('uint8')returnx#可视化滤波器defkernelvisual(model,layer_target=1,num_...
继续阅读 >