Code Monkey home page Code Monkey logo

contrawr's Introduction

Hi there 👋, this is Chaoqi YANG (杨超琪 in Chinese).

I work in a Fintech firm now. I obtained my PhD at UIUC, BE at SJTU.

  • 🏥 I’m leading the long-term development of PyHealth.
  • Currently, I am also drafting a textbook with my PhD advisor and other collaborators. It is about how to apply different deep learning models on specific healthcare data and applications.
  • ✈️ I like gym, hiking, sports, and travels. I maintained (irregularly) a photo collection.

contrawr's People

Contributors

ycq091044 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

Watchers

 avatar  avatar  avatar  avatar

contrawr's Issues

About augment function in utils

def noise_channel(ts, mode, degree, bound):
    """
    Add noise to ts
    
    mode: high, low, both
    degree: degree of noise, compared with range of ts    
    
    Input:
        ts: (n_length)
    Output:
        out_ts: (n_length)
        
    """

noise_channel需要一个单通道时间序列,但是调用它的add_noiseremove_noise传给noise_channelx[i,:],函数说明中说 x: (n_length, n_channel),那每次传给noise_channel的x不是变成了某个采样点的全通道信号吗,请问一下作者这里是否是有什么问题

    def add_noise(self, x, ratio):
        """
        Add noise to multiple ts
        Input: 
            x: (n_length, n_channel)
        Output: 
            x: (n_length, n_channel)
        """
        for i in range(self.n_channels):
            if np.random.rand() > ratio:
                mode = np.random.choice(['high', 'low', 'both', 'no'])
                x[i,:] = noise_channel(x[i,:], mode=mode, degree=0.05, bound=self.bound)
        return x
    
    def remove_noise(self, x, ratio):
        """
        Remove noise from multiple ts
        Input: 
            x: (n_length, n_channel)
        Output: 
            x: (n_length, n_channel)
        """
        for i in range(self.n_channels):
            rand = np.random.rand()
            if rand > 0.75:
                x[i, :] = denoise_channel(x[i, :], self.bandpass1, self.signal_freq, bound=self.bound) +\
                        denoise_channel(x[i, :], self.bandpass2, self.signal_freq, bound=self.bound)
            elif rand > 0.5:
                x[i, :] = denoise_channel(x[i, :], self.bandpass1, self.signal_freq, bound=self.bound)
            elif rand > 0.25:
                x[i, :] = denoise_channel(x[i, :], self.bandpass2, self.signal_freq, bound=self.bound)
            else:
                pass

        return x

ContraWR+ on time series

Is it a good idea to parameterize the weights where you calculate using the dot product between two latent vectors in the contraWR+. If we can how do you think doing it is a good idea. Let me know your thoughts on it, I shall experiment with them.

Supervised and untrained encoder

Can you please provide some information about how the supervised model and the untrained encoder are trained in the paper? My assumption is that the supervised model is trained on both pretext group + train group and the encoder model is trained on only the train group. When I did run the supervised.py script I was getting an accuracy of 78.28 and a kappa score of only 0.3871, clearly, the model is performing badly due to fewer training subjects and I was using the same random seed as yours. I have been experimenting on sleepEDF dataset.

And in the paper, why there is a difference in metrics between the table values and graph values. Do they point to the same results?

image
image

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.