AI4HealthUOL / SSSD-ECG

Repository for the paper: 'Diffusion-based Conditional ECG Generation with Structured State Space Models'
MIT License
36 stars 4 forks source link

Dataset #7

Closed dtt355 closed 1 year ago

dtt355 commented 1 year ago

https://figshare.com/s/43df16e4a50e4dd0a0c5 May I ask whether the data in this link is the data after preprocessing of the original data set or the data generated by the model?Thank you!

juanlopezcode commented 1 year ago

the data is the generated by the model, I just saw you have another question in different issue, I will reply there

juanlopezcode commented 1 year ago

seems deleted :)

dtt355 commented 1 year ago

https://mega.nz/folder/kT91jYpI#97GyTkVVUk97fzs1Oy4nBQ/folder/sW8UiBpT Yes, another problem has been solved, thank you very much! Is this linked data set the raw data after you preprocessed it? What data does each file hold?

dtt355 commented 1 year ago

(pytorch_gpu) root@13e519def43d:~/data1# python /root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/inference.py /root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/models/SSSD_ECG.py:177: SyntaxWarning: "is not" with a literal. Did you mean "!="? self.embedding = nn.Embedding(label_embed_classes, label_embed_dim) if label_embed_classes>0 is not None else None CUDA extension for cauchy multiplication not found. Install by going to extensions/cauchy/ and running python setup.py install. This should speed up end-to-end training by 10-50% Falling back on slow Cauchy kernel. Install at least one of pykeops or the CUDA extension for efficiency. {'diffusion_config': {'T': 200, 'beta_0': 0.0001, 'beta_T': 0.02}, 'wavenet_config': {'in_channels': 8, 'out_channels': 8, 'num_res_layers': 36, 'res_channels': 256, 'skip_channels': 256, 'diffusion_step_embed_dim_in': 128, 'diffusion_step_embed_dim_mid': 512, 'diffusion_step_embed_dim_out': 512, 's4_lmax': 1000, 's4_d_state': 64, 's4_dropout': 0.0, 's4_bidirectional': 1, 's4_layernorm': 1, 'label_embed_dim': 128, 'label_embed_classes': 71}, 'train_config': {'output_directory': 'sssd_label_cond', 'ckpt_iter': 'max', 'iters_per_ckpt': 4000, 'iters_per_logging': 100, 'n_iters': 100000, 'learning_rate': 0.0002, 'batch_size': 8, 'masking': '', 'missing_k': ''}, 'trainset_config': {'segment_length': 1000, 'sampling_rate': 100, 'finetune_dataset': 'ptbxl_all', 'data_path': '/root/data1/data/12-lead-generator/Dataset/data/ptbxl_test_data.npy'}, 'gen_config': {'output_directory': 'sssd_label_cond', 'ckpt_path': 'sssd_label_cond/'}} output directory sssd_label_cond/ch256_T200_betaT0.02 SSSD_ECG Parameters: 50.202504M Successfully loaded model at iteration 100000 begin sampling, total number of reverse steps = 200 generated 400 utterances of random_digit at iteration 100000 in 1273 seconds saved generated samples at iteration 100000 saved generated samples at iteration 100000 begin sampling, total number of reverse steps = 200 generated 400 utterances of random_digit at iteration 100000 in 1296 seconds saved generated samples at iteration 100000 saved generated samples at iteration 100000 begin sampling, total number of reverse steps = 200 generated 400 utterances of random_digit at iteration 100000 in 1290 seconds saved generated samples at iteration 100000 saved generated samples at iteration 100000 begin sampling, total number of reverse steps = 200 generated 400 utterances of random_digit at iteration 100000 in 1299 seconds saved generated samples at iteration 100000 saved generated samples at iteration 100000 begin sampling, total number of reverse steps = 200 generated 400 utterances of random_digit at iteration 100000 in 1286 seconds saved generated samples at iteration 100000 saved generated samples at iteration 100000 begin sampling, total number of reverse steps = 200 Traceback (most recent call last): File "/root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/inference.py", line 156, in generate(gen_config, File "/root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/inference.py", line 98, in generate generated_audio = sampling_label(net, (num_samples,8,1000), File "/root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/utils/util.py", line 154, in sampling_label epsilon_theta = net((x, cond, diffusionsteps,)) # predict \epsilon according to \epsilon\theta File "/root/anaconda3/envs/pytorch_gpu/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/models/SSSD_ECG.py", line 205, in forward x = self.residual_layer((x, label_embed, diffusion_steps)) File "/root/anaconda3/envs/pytorch_gpu/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "/root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/models/SSSD_ECG.py", line 153, in forward h, skip_n = self.residual_blocks[n]((h, label_embed, diffusion_step_embed))
File "/root/anaconda3/envs/pytorch_gpu/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/root/data1/data/12-lead-generator/SSSD-ECG-main/src/sssd/models/SSSD_ECG.py", line 98, in forward h = h + label_embed RuntimeError: The size of tensor a (400) must match the size of tensor b (15441) at non-singleton dimension 0

There is also a problem. When I load labels in the generated data file, the defined load label link is the tag file ptbxl_train_labels.npy, but the above error occurs at run time. Why is this?Thank you very much!

juanlopezcode commented 1 year ago

extrac the signals and labels from here: https://github.com/AI4HealthUOL/SSSD-ECG/blob/main/src/ptb_xl/ecg_data_preprocessing.ipynb

you have to load the signals e.g. 17441, 12, 1000, and the labels e.g. 17441,71. Labels that will be converted to 17441,128 after the embedding.

the code must run as indicated