一点见解,不断学习,欢迎指正
1、自定义loss层作为网络一层加进model,同时该loss的输出作为网络优化的目标函数
from keras.models import Model
import keras.layers as KL
import keras.backend as K
import numpy as np
from keras.utils.vis_utils import plot_model
x_train=np.random.normal(1,1,(100,784))
x_in = KL.Input(shape=(784,))
x = x_in
x = KL.Dense
1