Skip to content

Commit 56db166

Browse files
committed
developing Gaussian Noise Layer
1 parent 517a9c5 commit 56db166

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tensorlayer/layers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,15 +3677,19 @@ class GaussianNoiseLayer(Layer):
36773677
def __init__(
36783678
self,
36793679
layer = None,
3680-
# keep = 0.5,
3680+
sigma = 0.1,
36813681
name = 'gaussian_noise_layer',
36823682
):
36833683
Layer.__init__(self, name=name)
36843684
self.inputs = layer.outputs
36853685
print(" tensorlayer:Instantiate GaussianNoiseLayer %s: keep: %f" % (self.name, keep))
36863686
print(" Waiting for contribution")
36873687
with tf.variable_scope(name) as vs:
3688-
pass
3688+
noisy = np.random.normal(0.0 , sigma , tf.to_int64(input_layer).get_shape())
3689+
self.inputs = self.inputs + noisy
3690+
self.all_layers = list(layer.all_layers)
3691+
self.all_params = list(layer.all_params)
3692+
self.all_drop = dict(layer.all_drop)
36893693

36903694

36913695

0 commit comments

Comments
 (0)