W4 A1 UNQ_C3 assignment for Sequence models class

In this exercice, what is the right way to get dk ?