Closed kccheung closed 5 years ago
There's an initialisation/precalculation step before you do a log signature calculation, and you pass its result to LogSig
(like the logsig
function in iisignature
). LogSig
doesn't expect a number as its second argument, hence the error.
Somewhere, perhaps before all this, you need to do
s = iisignature.prepare(input_shape[-1],SIG_LEVEL)
(where input_shape[-1]
is whatever your dimension is).
Then replace the Lambda
layer with
model.add(Lambda(lambda x: LogSig(x, s), output_shape=(FEATURE_DIM,)))
.
By the way, it looks like you've taken something which was working with Sig
and changed it to LogSig
. If that's the case, note that the output_shape
will need to change. For example a calculation might need to change from iisignature.siglength
to iisignature.logsiglength
.
Thank you. I fixed it according to your instruction.
I received the below Runtime error when I used the below keras model with LogSig layer from
iisignature_tensorflow.py
inexamples
folder: