diff options
author | Soumith Chintala <soumith@fb.com> | 2015-05-18 23:35:14 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@fb.com> | 2015-05-18 23:35:14 +0300 |
commit | d3fe672c549a33527d40f1eb6036f4beb7407f9f (patch) | |
tree | 0bd3be8325f07e630c019150ec8ad757524d5b01 /test.lua | |
parent | 0908c98eadcc947b2836be6d8a42805f1d0fa9b6 (diff) |
Revert "Adding Batch L2 Normalization Layer that makes all rows of input Tensor unit L2 norm"
This reverts commit 905ea8c1a4033af2af0f90e92e16597f442f3512.
Diffstat (limited to 'test.lua')
-rw-r--r-- | test.lua | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -3708,29 +3708,6 @@ function nntest.Padding() mytester:assertTensorEq(gradInput, input, 0.00001, "Padding backward error") end -function nntest.L2Normalize() - local ini = math.random(6,8) - local inj = math.random(3,5) - local input = torch.randn(ini, inj) - - local module = nn.L2Normalize() - - -- test correctness of output - local output = module:forward(input) - local norms = torch.norm(output, 2, 2) - local desired_norms = torch.ones(ini) - mytester:assertTensorEq(norms, desired_norms, 0.000001, 'L2Normalize forward err') - - -- test the Jacobian - local err = jac.testJacobian(module,input) - mytester:assertlt(err, precision, 'error on state ') - - -- test IO correctness - local ferr, berr = jac.testIO(module,input) - mytester:asserteq(ferr, 0, torch.typename(module) .. ' - i/o forward err ') - mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ') -end - mytester:add(nntest) if not nn then |