Code Monkey home page Code Monkey logo

ecgxai's People

Contributors

mellevessies avatar rutgervandeleur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ecgxai's Issues

ecgxai in pytorch 2.0

Hello, congratulations for your great job.

Is it possible to use the app with pytorch 2.0?

Thanks

Differences between Code and European Heart Journal Publication

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:

  • According to page 8 in the supplement, there should be some sort of weight normalization after each convolution, which I did not find in ecgxai.network.causalcnn.modules.CausalConvolutionBlock.
  • More importantly, the decoder implemented by 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.

Shape and padding inconsistency in VAE_System

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.