Hi, I am recently running the recurrent-visual-attention.lua and find that in the examples we have
locator:add(nn.MulConstant(opt.unitPixels*2/ds:imageSize("h")))
which will have output locations in range [-opt.unitPixels_2/ds:imageSize("h"), opt.unitPixels_2/ds:imageSize("h")] in stead of [-1, 1]
but then the nn.SpatialGlimpse by default receives normalized input in range [-1, 1] based on
local yx = location[sampleIdx]
-- (-1,-1) top left corner, (1,1) bottom right corner of image
local y, x = yx:select(1,1), yx:select(1,2)
-- (0,0), (1,1)
y, x = (y+1)/2, (x+1)/2
I am wondering that whether there is some mismatch between the codes? Or I have some mis-understanding in this part?
Thanks in advance!
-- found that I makes a stupid mistakes.. sorry about that
Hi, I am recently running the
recurrent-visual-attention.lua
and find that in the examples we havelocator:add(nn.MulConstant(opt.unitPixels*2/ds:imageSize("h")))
which will have output locations in range [-opt.unitPixels_2/ds:imageSize("h"), opt.unitPixels_2/ds:imageSize("h")] in stead of [-1, 1]but then the
nn.SpatialGlimpse
by default receives normalized input in range [-1, 1] based onI am wondering that whether there is some mismatch between the codes? Or I have some mis-understanding in this part?
Thanks in advance!
-- found that I makes a stupid mistakes.. sorry about that