Yes, the Conv1D layer will use the PReLu activation function. When you are defining a Conv2D
layer like,
x = tf.keras.layers.Conv2D( 13 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' )( inputs )
The above statement is equivalent to,
x = tf.keras.layers.Conv2D( 13 , kernel_size=( 3 , 3 ) , strides=1 )( inputs )
x = tf.keras.layers.Activation( 'relu' )( x )
The reason for providing activation functions as separate layers is that sometimes we'll need to add our logic to the feature maps before passing the feature maps to the activation function.
For instance, a BatchNormalization
layer is added before passing the feature maps to the activation function,
x = tf.keras.layers.Conv2D( 13 , kernel_size=( 3 , 3 ) , strides=1 )( inputs )
x = tf.keras.layers.BatchNormalization()(x)
x = tf.keras.layers.Activation( 'relu' )( x )
Coming back to your question,
Some special activation functions like elu
, LeakyReLU
and PReLU
are added as separate layers and we can't include them in the Conv1D
layers using the activation=
argument.
Regarding the trainable parameters, the conv1d_18
layer has 15050 parameters which form the kernel in 1D convolution. These parameters have nothing to do with the activation function.
The 4900 parameters of PReLU
are the slope parameters which are optimized with backpropagation. These parameters, along with kernel weights, will update with every batch and hence are included in trainable parameters.
So, the outputs ( unactivated ) of the Conv1D
layer will pass through the PReLU
activation which indeed uses the slope parameter to calculate the activated outputs.