0

i have a convoutional neuronal network with keras:

 x = tf.keras.layers.Conv1D(128, 65, padding='same', strides=2,activation=None)(input)

The input has the size (8192,1)

if i check my model summary, the layer has following properties, output shape and params:

 (None, 4096, 128)    8448 

Here how to calculate the params:

Input I x I x C
Filter F x F (x K) // K times applied
Parameters (F x F x C + 1) x K // where +1 bias per filter, and K is the number of filters

i calculated the params -> (65 x 1 x 1 + 1) x 128 that gave me exact 8448. But i dont understand why the bias is inside it? I have activation=None.

here I read:

If use_bias is True, a bias vector is created and added to the outputs. Finally, if activation is not None, it is applied to the outputs as well.

I have not set bias to true and activation to none.

Khan
  • 1,418
  • 1
  • 25
  • 49

1 Answers1

2

The parameter use_bias is set to True by default, so this is the simple reason why your parameter count does not match. Activation also does not affect the use of biases.

Dr. Snoopy
  • 55,122
  • 7
  • 121
  • 140
  • ok thats easy :D is it even useful to have a bias without activation function? – Khan May 10 '20 at 18:47
  • @Khan My question already mentions that there is no relation between bias and activation functions – Dr. Snoopy May 10 '20 at 18:49
  • as it is here mentioned https://stackoverflow.com/questions/2480650/what-is-the-role-of-the-bias-in-neural-networks the bias can shift the activation function to left or right, could you give me an small explanation what is meant by that? – Khan May 10 '20 at 18:50