Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tribev2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,8 @@ def aggregate_features(self, batch):
elif self.config.extractor_aggregation == "sum":
out = sum(tensors)
if self.config.temporal_dropout > 0 and self.training:
for batch_idx in range(out.shape[0]):
mask = torch.rand(out.shape[1]) < self.config.temporal_dropout
out[batch_idx, mask, :] = torch.zeros_like(out[batch_idx, mask, :])
mask = torch.rand(out.shape[:2], device=out.device) < self.config.temporal_dropout
out = out.masked_fill_(mask.unsqueeze(-1), 0.0)
return out

def transformer_forward(self, x, subject_id=None):
Expand Down