@@ -52,18 +52,19 @@ function call_analyzer(input, aug::NoiseAugmentation, ns::AbstractOutputSelector
52
52
output_selector = AugmentationSelector (output_indices)
53
53
54
54
p = Progress (aug. n; desc= " Sampling NoiseAugmentation..." , showspeed= aug. show_progress)
55
+
55
56
# First augmentation
56
- input_aug = similar (input)
57
- input_aug = sample_noise! (input_aug , input, aug)
58
- expl_aug = aug. analyzer (input_aug , output_selector)
57
+ noisy_input = similar (input)
58
+ noisy_input = sample_noise! (noisy_input , input, aug)
59
+ expl_aug = aug. analyzer (noisy_input , output_selector)
59
60
sum_val = expl_aug. val
60
61
next! (p)
61
62
62
63
# Further augmentations
63
64
for _ in 2 : (aug. n)
64
- input_aug = sample_noise! (input_aug , input, aug)
65
- expl_aug = aug. analyzer (input_aug , output_selector)
66
- sum_val += expl_aug. val
65
+ noisy_input = sample_noise! (noisy_input , input, aug)
66
+ expl_aug = aug. analyzer (noisy_input , output_selector)
67
+ sum_val . += expl_aug. val
67
68
next! (p)
68
69
end
69
70
78
79
function sample_noise! (
79
80
out:: A , input:: A , aug:: NoiseAugmentation
80
81
) where {T,A<: AbstractArray{T} }
81
- out .= input .+ rand (aug. rng, aug. distribution, size (input))
82
+ out = rand! (aug. rng, aug. distribution, out)
83
+ out .+ = input
84
+ return out
82
85
end
83
86
84
87
"""
0 commit comments