Skip to content
Snippets Groups Projects
Commit a11fbe94 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Vectorized '_normalize_data()' during data generation.

parent d4a2912c
Branches
No related tags found
No related merge requests found
......@@ -260,11 +260,9 @@ class TrainingDataGenerator:
Array containing normalized input data.
"""
normalized_input_data = []
for entry in input_data:
max_function_value = max(max(np.absolute(entry)), 1)
normalized_input_data.append(entry / max_function_value)
return np.array(normalized_input_data)
normalized_input_data = input_data/np.maximum(
1, np.max(np.abs(input_data), axis=1))[:, np.newaxis]
return normalized_input_data
@staticmethod
def _save_data(directory, data):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment