According to the [arXiv, https://arxiv.org/abs/1402.3511], My understanding is the mask matrix shape is
[num_group * group_size, num_group * group_size], can also image the mask is constructed by [num_group, num_group] but each element in matrix is a sub-matrix which shape is
[group_size, group_size];
self.clockwork_mask = tf.constant(np.triu(np.ones([self.config.num_hidden, self.config.num_hidden])), dtype=tf.float32, name="mask")
mask = np.zeros((self.config.num_hidden, self.config.num_hidden))
for i in range(len(self.clockwork_periods)):
mask[i*self.group_size:(i+1)*self.group_size, i*self.group_size:] = 1
self.clockwork_mask = tf.constant(mask, name="mask")