snorkel.augmentation.ApplyEachPolicy¶
-
class
snorkel.augmentation.
ApplyEachPolicy
(n_tfs, keep_original=True)[source]¶ Bases:
snorkel.augmentation.policy.core.Policy
Apply each TF individually to each data point.
This can be used as a baseline policy when using complex transformations which might degenerate if combined.
- Parameters
n_tfs (
int
) – Total number of TFskeep_original (
bool
) – Keep untransformed data point in augmented data set? Note that even if in-place modifications are made to the original data point by the TFs being applied, the original data point will remain unchanged.
Example
>>> policy = ApplyEachPolicy(3, keep_original=True) >>> policy.generate_for_example() [[], [0], [1], [2]]
-
__init__
(n_tfs, keep_original=True)[source]¶ Initialize self. See help(type(self)) for accurate signature.
- Return type
None
Methods
__init__
(n_tfs[, keep_original])Initialize self.
generate
()Generate a sequence of TF indices.
Generate all length-one sequences for a single example.