Open
Description
Problem
lift_data
is applied to input signals below:
def main():
args = create_parser()
# Load input data, prepare tuple((1850, 1) and (1850, 50))
grid, input_data = load_input_signals(args.input_directory)
# Apply lifting factor to input signal data
lifted_input_data = lift_data(input_data, args.lift_factor)
...
The following is the implementation of lift_data
:
def lift_data(data_input: np.ndarray, lift=1):
"""Lifts values of data_input.
Adds 'lift' * the minimum value in data_input to data_input element-wise.
Parameters
----------
data_input: 2d array like
The matrix containing a series of signals to be decomposed. Has dimensions N x M where N is the length
of each signal and M is the number of signals.
lift: float
The factor representing how much to lift 'data_input'.
Returns
-------
2d array like
The matrix that contains data_input - (min(data_input) * lift).
"""
return data_input + np.abs(np.min(data_input) * lift)
While the the function is expected to return data_input - (min(data_input) * lift)
the actual code is written as return data_input + np.abs(np.min(data_input) * lift)
Proposed solution
Double check literature (if there is one)
Metadata
Metadata
Assignees
Labels
No labels