自定义网络层
import tensorflow as tfimport tensorflow as kerasfrom tensorflow.keras import layers,optimizers,losses,Sequentialclass MyDense(layers.Layer): def __init__(self,inp_dim,outp_dim): super(MyDense,self).__init__() #创建权值张量并添加到管理列表中,设置为需要