iisignature
iisignature copied to clipboard
sig, logsig, sigbackprop, logsigbackprop do not respect input types
As title. sigbackprop
and logsigbackprop
return float32 even when input is float64, and sig
and logsig
return float64 if the input is float32.
e.g.
import numpy as np
import iisignature as ii
x = np.random.uniform(size=(3, 4)).astype(np.float64)
y = np.random.uniform(size=(84,))
print(ii.sigbackprop(y, x, 3).dtype) # float32
I haven't tested the other functions in the library, I don't know if they suffer from similar issues.
All internal calculations use float64 (i.e. double precision). It would make sense for float64 to be the type of all the outputs. It just happens that sig
was implemented first and outputs in float32, which can easily be changed.