Skip to content

Commit

Permalink
Fixed a small bug rarely causing type mismatch
Browse files Browse the repository at this point in the history
when you use the derivative_extraction function, you are likely to concatenate it with your features, and your features might have a varing number of types which might be sensitive to memory usage.

for example in my project i have a large dataset (which is normal for the use case of this library) which i use float32 as the datatype of it's values, but when i used the derivative_extraction it calculated it's values in float64 and when i concatenated the derivatives and the original features all the values where converted to float64 and the system's memory usage was doubled

this is not that critical and it could be fixed by converting types from outside the library call, but why bother with the inconvenience when changing the datatype from the incoming feature's datatype is not needed.
  • Loading branch information
omaraltayyan authored Jul 5, 2018
1 parent f5689ef commit 2593279
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion speechpy/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def derivative_extraction(feat, DeltaWindows):
rows, cols = feat.shape

# Difining the vector of differences.
DIF = np.zeros(feat.shape, dtype=float)
DIF = np.zeros(feat.shape, dtype=feat.dtype)
Scale = 0

# Pad only along features in the vector.
Expand Down

0 comments on commit 2593279

Please sign in to comment.