Open markub3327 opened 2 years ago
Solution:
# (Timestep, Patch)
def create_look_ahead_mask(size_0, size_1):
n = int(size_0 * (size_0+1) / 2)
mask = tfp.math.fill_triangular(tf.ones((n,), dtype=tf.int32), upper=False)
mask = mask[:, tf.newaxis, :, tf.newaxis] # (timestep, 1, timestep, 1)
return mask
Hello,
this code:
is equivalent to:
Here is another code very close to the above:
But what is the equivalent to it with using
tfp.math.fill_triangular
or another matrix operation?