umcutrecht-ecgxai / ecgxai Goto Github PK
View Code? Open in Web Editor NEWNeatly packaged AI methods for explainable ECG analysis
License: GNU Affero General Public License v3.0
Neatly packaged AI methods for explainable ECG analysis
License: GNU Affero General Public License v3.0
Hello, congratulations for your great job.
Is it possible to use the app with pytorch 2.0?
Thanks
Dear authors,
thanks for publishing your great repo!
I tried to train my own VAE using your code, and although it works in principle, I stumbled upon several questions. Comparing the code to your European Heart Journal publication (https://doi.org/10.1093/ehjdh/ztac038), in particular the supplemental material, I realized a couple of differences:
ecgxai.network.causalcnn.modules.CausalConvolutionBlock
.ecgxai.network.causalcnn.decoder.CausalCNNVDecoder
has ordinary convolutions instead of transposed convolutions. To my understanding, this is because here the forward
parameter passed to CausalConvolutionBlock()
actually sets the value of final
. Changing this by explicitly setting forward=forward
leads to an error when starting training: "RuntimeError: Trying to create tensor with negative dimension -512: [128, 64, 1, -512]". I can provide more details if needed.I'd be grateful if you could shed some light on this.
Its not very clear in the publication what's the beta being used for the optimal run,
The two most important hyperparameters in the β-VAE were the number of ECG factors and the β-value. For both, values of 8, 16, 32, 64, and 128 were evaluated.
Hi, thanks for your wonderful work!
I was trying to run this model, specifically VAE, on my data and I noticed it doesn't work due to an inconsistency:
In systems/VAE_system.py:124:
reconstruction_mean, reconstruction_std = self.decoder(z)
The above line uses CausalCNNVDecoder from ecgxai.network.causalcnn.decoder.
In the above decoder we have:
ecgxai.network.causalcnn.decoder:42:
out = self.causal_cnn(out)
Which uses CausalCNN block from .modules.
In that file, specifically in lines 71 to 108, the causal CNN is defined the same for both encoder and decoder.
More specifically, in ecgxai.network.causalcnn.modules.py:75:
Conv1d = torch.nn.Conv1d if forward else torch.nn.ConvTranspose1d
If forward is False, which is the case in the decoder, you are using ConvTranspose1d which reduces the length of the input by padding (in contrast to Conv1d which adds that amount to the length). However, the Chomp1d blocks are still kept intact which makes the input length to reach zero by repetitively subtracting the amount of padding from it.
For instance, in case of my data (batch_size=256, ECG_length=5000), this is the shape of the input going through CausalCNN in Encoder:
Input shape: torch.Size([256, 128, 5000]) After conv1: torch.Size([256, 64, 5512]) After chomp1: torch.Size([256, 64, 5000]) After relu1: torch.Size([256, 64, 5000]) After conv2: torch.Size([256, 64, 5512]) After chomp2: torch.Size([256, 64, 5000]) After relu2: torch.Size([256, 64, 5000])
However, the shape of the input going through CausalCNN in decoder is:
Input shape: torch.Size([256, 64, 600]) After conv1: torch.Size([256, 128, 88]) After chomp1: torch.Size([256, 128, 0]) After relu1: torch.Size([256, 128, 0])
Which causes an error when reaching conv2.
As far as I understood from the repository, there is no other type of CausalCNN defined for the Decoder or any other condition being set upon it to account for this bug.
What Encoder/Decoder was then used to produce the results of the paper?
Thanks and regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.