Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_part_array_merge #2

Open
zl13133581232 opened this issue Jan 16, 2025 · 1 comment
Open

load_part_array_merge #2

zl13133581232 opened this issue Jan 16, 2025 · 1 comment

Comments

@zl13133581232
Copy link

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?

@hyunho-mo
Copy link

hyunho-mo commented Jan 16, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants