iisignature icon indicating copy to clipboard operation
iisignature copied to clipboard

sig, logsig, sigbackprop, logsigbackprop do not respect input types

Open patrick-kidger opened this issue 4 years ago • 1 comments

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.

patrick-kidger avatar Aug 15 '19 17:08 patrick-kidger

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.

bottler avatar Aug 15 '19 20:08 bottler