N-CMAPSS_DL icon indicating copy to clipboard operation
N-CMAPSS_DL copied to clipboard

load_part_array_merge

Open zl13133581232 opened this issue 11 months ago • 1 comments

Hello author, sorry to bother you. I would like to ask

Load created samples

At first, you should load each of the npy files created in /Samples_whole folder. Then, the samples from the different engines should be aggregated.

def load_part_array_merge (npz_units):
    sample_array_lst = []
    label_array_lst = []
    for npz_unit in npz_units:
      loaded = np.load(npz_unit)
      sample_array_lst.append(loaded['sample'])
      label_array_lst.append(loaded['label'])
    sample_array = np.dstack(sample_array_lst)
    label_array = np.concatenate(label_array_lst)
    sample_array = sample_array.transpose(2, 0, 1)
    return sample_array, label_array

The shape of your sample array should be (# of samples from all the units, window size, # of variables) What is the purpose of this part?

zl13133581232 avatar Jan 16 '25 06:01 zl13133581232

Hi @zl13133581232 ,

Thank you for reaching out to us. The purpose of the function is, namely, to merge numpy arrays having the data from each unit.

As outlined in the README, This N-CMAPSS consists of several units (i.e., engines); the data for each unit comprises samples (i.e., measurements) and labels. To prepare the training/test data for training your DL model, you need to prepare one array concatenating all those samples/labels from different units. Namely, the function loads the arrays from each unit and merges to provide you with sample/label arrays to be used for training/test.

If you have any further questions, don't hesitate to contact me at this email address: "[email protected]".

Best, Hyunho

hyunho-mo avatar Jan 16 '25 12:01 hyunho-mo