towhee.models.collaborative_experts.collaborative_experts.drop_nans¶
- towhee.models.collaborative_experts.collaborative_experts.drop_nans(x, ind, validate_missing)[source]¶
Remove nans, which we expect to find at missing indices.
- Parameters:
x (torch.Tensor) – features
ind (torch.Tensor) – binary values denoting whether or not a given feature is present
validate_missing (bool) – whether to validate that the missing location contains a nan.
- Returns:
the features, with the missing values masked to zero.
- Return type:
(torch.tensor)