Skip to content

Commit

Permalink
Merge pull request torch#268 from torch/revertL2
Browse files Browse the repository at this point in the history
Revert "Adding Batch L2 Normalization Layer that makes all rows of in…
  • Loading branch information
soumith committed May 18, 2015
2 parents 0908c98 + d3fe672 commit 88ea556
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 64 deletions.
40 changes: 0 additions & 40 deletions L2Normalize.lua

This file was deleted.

1 change: 0 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ include('WeightedEuclidean.lua')
include('PairwiseDistance.lua')
include('CosineDistance.lua')
include('DotProduct.lua')
include('L2Normalize.lua')

include('Exp.lua')
include('Log.lua')
Expand Down
23 changes: 0 additions & 23 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88ea556

Please sign in to comment.