I'm a theano and lasagne user.
I have a problem dealing with the variable length of the input matrix.
i.e)
x1 = [0, 1, 3]
x2 = [1, 2]
matrix_embedding = [ [ 0.1, 0.2, 0.3],
[ 0.4, 0.5, 0.6],
[ 0.2, 0.3, 0.5],
[ 0.5, 0.6, 0.7], ]
matrix_embedding[x1] = [
[ 0.1, 0.2, 0.3],
[ 0.4, 0.5, 0.6],
[ 0.5, 0.6, 0.7]
]
matrix_embedding[x2] = [
[ 0.4, 0.5, 0.6],
[ 0.2, 0.3, 0.5],
]
So, I try to use the padding.
matrix_padding_embedding = [ [ 0.1, 0.2, 0.3],
[ 0.4, 0.5, 0.6],
[ 0.2, 0.3, 0.5],
[ 0.5, 0.6, 0.7],
[ 0.0, 0.0, 0.0] ]
x1 = [0, 1, 3]
x2 = [1, 2, -1]
matrix_embedding[x1] = [
[ 0.1, 0.2, 0.3],
[ 0.4, 0.5, 0.6],
[ 0.5, 0.6, 0.7]
]
matrix_embedding[x2] = [
[ 0.4, 0.5, 0.6],
[ 0.2, 0.3, 0.5],
[ 0.0, 0.0, 0.0] ]
But, after processing, theano updates the parameters matrix_padding_embedding, so, matrix_padding_embedding[-1] no longer a 0.
How to keep the weight value to zero in matrix_padding_embedding[-1]?
Or, whether there are other ways of dealing with variable length?