csc-training / intro-to-dl

Introduction to deep learning
MIT License
47 stars 48 forks source link

Description and code example do not match #12

Open Danghor opened 1 year ago

Danghor commented 1 year ago

https://github.com/csc-training/intro-to-dl/blob/4e99811d1fc7c3e22f4413938fcc9f949c1601dc/day1/04-tf2-imdb-rnn.ipynb#L78

The comment says that the sequences are truncated and padded at the end. However, the following code calls keras.utils.data_utils.pad_sequences (which we can see using the help() function). This function will by default truncate and pad in the beginning. When we look at the documentation for tf.keras.preprocessing.sequence, it says that this API is deprecated. I don't know that function should be used in the end, but the description and the code do not match. Maybe

padding='post',
truncating='post',

should be added or the description changed.