Giter VIP home page Giter VIP logo

nu_gan's People

Contributors

bohu615 avatar tangye95 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  avatar

Watchers

 avatar  avatar  avatar

nu_gan's Issues

Performance of cell-level clustering

Hello,

I've been trying to reproduce the results of cell-level clustering from the paper.

According to Table II, for dataset A, your method achieved purity = 0.855, entropy = 0.750 and f-score = 0.863.

I have run your code with different configurations, but for some reason, I can't achieve the same results as those reported in the paper.

  • According to the paper, the model was trained with n_epoch = 10, batchsize = 64, lr = 2e-4

    • With these parameters, I get purity = 0.511, entropy = 1.548 and f_score = 0.589
  • Using the defaults of the code: n_epoch = 50, batchsize = 10, lr = 1e-4

    • I get purity = 0.725, entropy = 1.137 and f_score = 0.732

I also ran the code with other configurations to investigate:

  • n_epoch = 10, batchsize = 64, lr = 1e-4

    • purity = 0.535, entropy = 1.451, f_score = 0.617
  • n_epoch = 50, batchsize = 64, lr = 1e-4

    • purity = 0.668, entropy = 1.087, f_score = 0.689
  • n_epoch = 50, batchsize = 10, lr = 2e-4

    • purity = 0.725, entropy = 1.145, f_score = 0.733

It seems that for all the runs, my results are significantly lower than the results you got. Could you please provide me some guidance on what could be causing this discrepancy? Any thoughts would be highly appreciated!

Thank you,
Nathalia

Errors in running the code

Hi,
I have been trying to use your code, I encountered a lot of errors. I could able to solve some errors for task cell segmentation, image classification. The solutions are:

segmentation_functions

#line 309, 310
#add
#width_ = int(width/2)
#height_ = int(height/2)
#exrperiment.py
#line 5,6
#add
#from utils.segmentation_functions
#from utils.gan_model

segmentation_functions

line 307

img = np.array(Image.fromarray(img).resize(size=(height, width)))

segmentation_functions

line 315

list(image_dict.values())

With above you could run two tasks; cell segmentation and image classification.

gan_model

line 233 and 240

broadcast = non_blocking

#gan_model
#line 233, 241, linear
#weight_values = weight_values.permute(1, 0)

weight = weight.permute(3,2,1,0)

#line 741
#one = torch.tensor(1, dtype = torch.float)
#line 792

with torch.no_grad():

But when I'm stuck on cell representation, I'm not able to solve those errors, could you please help on this. Codes are outdated and need to be updated. The error I'm stuck on is this:

folder_name:1620389608
Traceback (most recent call last):
File "/content/nu_gan/nu_gan.py", line 57, in
ld, lg, lq, save_model_steps)
File "/content/nu_gan/utils/experiment.py", line 78, in cell_representation
dis_category=dis_category, ld=ld, lg=lg, lq=lq, save_model_steps=save_model_steps)
File "/content/nu_gan/utils/gan_model.py", line 788, in train_representation
fake = Variable(netG(noisev).data)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/nu_gan/utils/gan_model.py", line 148, in forward
x = self.layer_up_1(x)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/nu_gan/utils/gan_model.py", line 78, in forward
shortcut = self.upsample(shortcut) #upsampleconv
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/upsampling.py", line 141, in forward
return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 3469, in interpolate
raise ValueError("only one of size or scale_factor should be defined")
ValueError: only one of size or scale_factor should be defined

invalid gradient at index 0 - expected shape [] but got [1]

Hi,
I want to reproduce your excellent work on my computer. When I run the nu_gan.py with --task cell_representation, I got the following errors:
Traceback (most recent call last):
File "/home/nu_gan/nu_gan.py", line 64, in
ld, lg, lq, save_model_steps)
File "/home/nu_gan/utils/experiment.py", line 78, in cell_representation
dis_category=dis_category, ld=ld, lg=lg, lq=lq, save_model_steps=save_model_steps)
File "/home/nu_gan/utils/gan_model.py", line 776, in train_representation
errD_real.backward(mone)
File "/home/anaconda2/lib/python2.7/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/anaconda2/lib/python2.7/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: invalid gradient at index 0 - expected shape [] but got [1]
INFO:root:Using python for large_image caching

I review the code and guess maybe it is because of the definition of mone and I tried these format:
mone = torch.Tensor([-1.0])
or
mone = torch.FloatTensor([-1.0])

Both of them don't work.

Would you like give me some clues to solve the problem? Thank you.

Datasets mismatch

Hello,

Thank you for making this code available!

There's a mismatch between the Datasets described in the paper and the data provided on this page.

From the paper description:

  • Dataset A has 11 negative images
    • includes 1995 cell-level images
  • Dataset B has 29 positive images
  • Dataset C = Dataset A + Dataset B
  • Dataset D has 72 positive and 132 negative images

Data provided here:

  • dataset_A folders:

    • original > negative_images: contains 11 images (corresponding to Dataset A from the paper)
    • original > positive_images: contains 29 images (corresponding to Dataset B from the paper)
    • cell_level_label: contains 4 files (X_train.npy, X_test.npy, y_train.npy, y_test.npy)
      • len(X_train) = 1631
      • len(X_test) = 364
      • 1631 + 364 = 1995
      • So these 4 files most probably correspond to the cell-level images from Dataset A and their labels
  • dataset_B folders:

    • original > negative_images: contains 132 images (corresponding to Dataset D from the paper)
    • original > positive_images: contains 72 images (corresponding to Dataset D from the paper)
    • cell_level_label: contains exactly the same 4 files as dataset_A > cell_level_label, therefore correspond to the cell-level images from Dataset A and their labels

In summary, the original images from all datasets in the paper were provided. However, only the cell-level images and labels for Dataset A are available. Would it be possible to provide those for the other datasets as well?

Thank you

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.