What does padding
argument do in keras?
In NLP:
tf.keras.preprocessing.sequence.pad_sequences(xtrain, padding='')
In CNN:
model.add(Convolution2D(64,(3,3),padding=''))
What does padding
argument do in keras?
In NLP:
tf.keras.preprocessing.sequence.pad_sequences(xtrain, padding='')
In CNN:
model.add(Convolution2D(64,(3,3),padding=''))
With pad_sequences
it simply indicates whether sequences that are shorter than the specified max length (or, if unspecified, the length of the longest sequence in xtrain
) are filled with the padding value in the beginning or in the end of the sequence (such as to attain the desired length).
With Convolution2d
it indicates whether to pad (i.e. extend the tensor (e.g. pixel matrix or feature map) with additional rows and columns outside the border) or not.
I suggest looking into the respective documentations.