def Setup(self, bottom): super(NormalizeLayer, self).Setup(bottom) norm_out = [ops.L2Norm(bottom[0], **self._l2norm_param)] scale_out = ops.Scale( norm_out + [blob['data'] for blob in self.scale_blobs], **self._scale_param) return scale_out
def l2_normalize( x, dim, epsilon=1e-12, name=None, ): return _ops.L2Norm( x, axis=dim, num_axes=1, eps=epsilon, name=name, )
def LayerSetup(self, bottom): norm_out = [_ops.L2Norm(bottom, **self.l2norm_arguments)] norm_out += [blob['data'] for blob in self._blobs] return _ops.Affine(norm_out, **self.affine_arguments)
def l2_normalize(x, dim, epsilon=1e-12, name=None): return ops.L2Norm(inputs=x, axis=dim, num_axes=1, eps=epsilon)