一、自定义网络层layer
- 继承
tf.keras.layers.Layer
类 - 使用
tf.keras.layers.Lambda
类
下面这个例子就包含了以上两种形式:
import numpy as np
from tensorflow import keras
class CustomizedDenseLayer(keras.layers.Layer):
def __init__(self, units, activation