deepof.model_utils.create_look_ahead_mask
- deepof.model_utils.create_look_ahead_mask(size: int)
Create a triangular matrix containing an increasing amount of ones from left to right on each subsequent row.
Useful for transformer decoder, which allows it to go through the data in a sequential manner, without taking the future into account.
- Parameters:
size (int) – number of time steps in the sequence