Is it possible to use a (trainable) vector/matrix to set "defaultHiddenActivation" in PastValue or FutureValue ?
Hi,
I'm trying to code NTM using CNTK.
I'd like to set trainable memory bias as "defaultHiddenActivation" in PastValue function.
Is it possible to use a (trainable) vector/matrix to set "defaultHiddenActivation" in PastValue or FutureValue ?
This is not directly available, but with a trick. Is this a global vector you want to train, or does it depend on the sequence?
If it is a global vector, you can do something like this:
# global vector you want to train
gv = Parameter (dim, 1)
# inside recurrence over x(t)
px = PastValue (0, x)
px1 = BS.Boolean.If (BS.Loop.IsFirst (x), gv, px)
What If() does is select from two inputs based on whether a condition variable is 0 (false) or 1 (true).
If it depends on the sequence, it's a little more complex, I will respond when you confirm.
It is a global vector.
Thank you for sharing your trick. I will try it right now !!