def get_output_for(self, input, deterministic=False, **kwargs):
"""
Parameters
----------
input : tensor
output from the previous layer
deterministic : bool
If true noise is disabled, see notes
"""
if deterministic or self.sigma == 0:
return input
else:
return T.clip(input + self._srng.normal(input.shape,
avg=0.0,
std=self.sigma), 0.0, 1.0)
评论列表
文章目录