-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f50f9b
commit 6ff9682
Showing
3 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
dacapo/experiments/trainers/gp_augments/gaussian_noise_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from .augment_config import AugmentConfig | ||
|
||
import gunpowder as gp | ||
|
||
import attr | ||
|
||
|
||
@attr.s | ||
class GaussianNoiseAugmentConfig(AugmentConfig): | ||
mean: float = attr.ib( | ||
metadata={"help_text": "The mean of the gaussian noise to apply to your data."}, | ||
default=0.0, | ||
) | ||
var: float = attr.ib( | ||
metadata={"help_text": "The variance of the gaussian noise."}, | ||
default=0.05, | ||
) | ||
|
||
def node(self, raw_key: gp.ArrayKey, _gt_key=None, _mask_key=None): | ||
return gp.NoiseAugment( | ||
array=raw_key, mode="gaussian", mean=self.mean, var=self.var | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters