ttgump / scDeepCluster

scDeepCluster for Single Cell RNA-seq data
Apache License 2.0
99 stars 36 forks source link

some question about "code" #3

Closed xuebaliang closed 5 years ago

xuebaliang commented 5 years ago

hello, I have some question about the code. the first question: ''' zinb = ZINB(pi, theta=disp, ridge_lambda=self.ridge, debug=self.debug) self.loss = zinb.loss ''' the model contains the above loss function but I find that the loss function of ZINB class needs two parameters(y_true and y_pred), you may not pass arguments to it. the second question: ''' loss = self.model.train_on_batch(x = [x_counts[index batch_size:(index + 1) batch_size], sf[index batch_size : (index + 1) batch_size]], y = [p[index batch_size:(index + 1) batch_size], raw_counts[index batch_size:(index + 1) batch_size]]) ''' what's the action of y? what can it calculate? the third question: the preprocessing progress transform the count data to normalized data, but you may pass the normalized data to the neural network, why not the count data based on your model? thank you!

ttgump commented 5 years ago

Hi,

Thanks for the email. Yes, ZINB loss need y_true and y_pred, when you call fit/train_on_batch function, keras will pass y_true and y_pred to ZINB loss, just like typical MSE and cross entropy losses. y is the parameter of train_on_batch function, look at the keras document: https://keras.io/models/model/ The input of the model is normalized data, but when fitting ZINB loss, the y_true is raw count data. It can work if passing the raw count data as input, but during optimization procedure, count data might cause problem for gradient calculation. So I used normalized data, since it is continuous. Best,

Tian

From: xuebaliang notifications@github.com Reply-To: ttgump/scDeepCluster reply@reply.github.com Date: Wednesday, June 26, 2019 at 7:59 AM To: ttgump/scDeepCluster scDeepCluster@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [ttgump/scDeepCluster] some question about "code" (#3)

hello, I have some question about the code. the first question: ''' zinb = ZINB(pi, theta=disp, ridge_lambda=self.ridge, debug=self.debug) self.loss = zinb.loss ''' the model contains the above loss function but I find that the loss function of ZINB class needs two parameters(y_true and y_pred), you may not pass arguments to it. the second question: ''' loss = self.model.train_on_batch(x = [x_counts[index batch_size:(index + 1) batch_size], sf[index batch_size : (index + 1) batch_size]], y = [p[index batch_size:(index + 1) batch_size], raw_counts[index batch_size:(index + 1) batch_size]]) ''' what's the action of y? what can it calculate? the third question: the preprocessing progress transform the count data to normalized data, but you may pass the normalized data to the neural network, why not the count data based on your model? thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

xuebaliang commented 5 years ago

Thank you for your reply. I will look over it again carefully. Thanks very much!

xuebaliang commented 5 years ago

excuse me, can you send me the specific numerical value about the figure2.a, figure2.b and figure3.a in your paper?Because when I run your github code on your dataset, there are some bias of them. Certainly, I may make some error in parameter setting. Thanks!

ttgump commented 5 years ago

Sure. How can I share to you?

xuebaliang commented 5 years ago

Thanks! I just saw your reply. My email is clandzyy@pku.edu.cn. You can email these to me. Thanks very much.

ttgump commented 5 years ago

The version of Keras and Tensorflow will also change the performance, just to remind you. Deep learning is tricky😂