GithubHelp home page GithubHelp logo

b-cos's People

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

Watchers

 avatar  avatar  avatar

b-cos's Issues

Transfer Learning

Hello,

thanks for your fascinating work. I am trying to use the B-cos network (the densenet121 named “densenet_121_cossched”) in my research but I struggle with having it transfer effectively to smaller datasets, e.g. CUB2011. In fact, it overfits much more ( much worse final test acc) and improves a lot slower than the conventional densenet (In fact, only retraining the final layer leads to no learning whatsoever across a range of hyperparameters that all work for the conventional one). Since you have experience with training this network, I figure I might just ask you:

  • How sensitive was the training to optimized hyperparameters? Do I “just” need to tune regularization etc?
  • Have you done some experiments on transfer learning and maybe figured out effective methods?
  • Could B-cos networks be less suited for fine-grained-classification?
  • How exactly did you train the model? From my point of view your training code does not work, as the trainer class does not get a “loss” argument or am I missing something? I am encountering nan as loss, when using BCE.
  • Did you investigate the impact of norming w in Equation 3 in the paper (maybe with increased B) so that the model rescales the outputs himself?

Any answers would be greatly appreciated :)

Greetings

Cannot train on TinyImagenet

Hello,

I attempting to run one of the basic experiments with the TinyImagenet dataset. Below are the steps I've taken and the issues I am running into. I would very much appreciate any help.

I've downloaded the tiny-imagenet-200 dataset from the following locations: http://cs231n.stanford.edu/tiny-imagenet-200.zip

I unzipped to the ./data folder where I then resorted the data into the expected format for the train and val folders. The directory structure is as follows:

tiny-imagenet-200
    train/
        class1/
            sample1.jpg
            sample2.jpg
            ...
        class2/
            sample1.jpg
            sample2.jpg
            ...
    val/
        class1/
            sample1.jpg
            sample2.jpg
            ...
        class2/
            sample1.jpg
            sample2.jpg
            ...

I then tried to run the experiment for Imagenet on this dataset with the following command:

py experiments/Imagenet/bcos/model.py --single_epoch=true --experiment_name=resnet_34 --dataset_name=TinyImagenet --model_config=bcos

It seems like it loads up the data but errors out with the following:

image

I then assumed that there may be something wrong with the data loader so I then attempted to simply load the data and iterate through the Dataloader. This is the result:

image

Not sure if I am doing anything wrong. Any input would be appreciated.

Thanks

BcosConv3D

Hi all,

Thanks for the great contribution. I was wondering if there is a 3D version of BcosConv3D? or if there is any limitation to scale from 2D to 3D. I would like to apply it for tumor lesion segmentation in 3D MRI.

Best,
Sulaiman

Localisation Metric

Thank you for your nice work!

I am a beginner in interpretability and would like some quantitative metrics assessing the "interpretability." I found the "localization metric" in your paper really interesting but unfortunately could find the definition for it.

I am wondering if you could point me to some repositories/papers, or suggest some other promising metrics.

Thank you so much!

Issues in path and possible memory leak

Hi all, I was trying to run the code but I faced multiple issues:

  1. I am running the experiments/Imagenet/bcos/model.py​, the save_path in the code is still trying to reach the CIFAR10 dataset.

  2. In model.py, get_optimizer():

"the_model" does not have an attribute called "opti"

  1. after spending some time I managed to solve above issues (not sure if it is gonna harm the functionality), but when I run the code the GPU runs out of memory! I played with the batch_size, but no luck.
    I guess that is due to a memory leak somewhere. Can anyone verify that?

Where is train.py?

Hi, Thanks for your interesting paper.
I'm trying to train your model but only I can find is Trainer class in training folder and not the training loop code.
Can you please add your code for training loop code OR
give some guidelines for reproducing your implementation?

Thanks a lot.

Can you help with some of the terms in the paper

Hi , thanks for your work. It really open my mind for the interpretable of DNN with a replacement of linenar transform .
But when reading the paper ,i have some point not understanding well as below, so if you can help to answear it ?
1.What kind of metric is the 'localisation metric',what 's the physical meaning? (Fig 6)
2.What's the meaning of baseline 'orcale attribution' and 'uniform attribution' ?(Fig 6)
image
3.Is there some parameter refer to the area in red ? Or just for better visual ? (Fig 2)
image

Result folder

Hello

I have a few questions regarding the contents of the result folder:

1- How have you calculated the logit.np? the shape of this array is [50000,2]. 50000 is the number of images in the ImageNet validation set, but I cannot understand where 2 comes from. Is there any way that I can (re)produce it?
2- Could you please provide more information to help me better understand the contents of the feature_layer_x.json? How are the neurons indexed? What do the values of each neuron represent?
3- How have you generated feature_layer_x_neurons_sorted.txt?

Thanks

Code Running Erro

By following the README of Training,an error happens when run the code as below.
Could you help to check it ,thanks !

Traceback (most recent call last):
File "D:/1.Study/PycharmProjects/Reproduce/B-cos-main/experiments/Imagenet/bcos/model.py", line 93, in
start_training(cmd_args, get_model, get_optimizer)
File "D:\1.Study\PycharmProjects\Reproduce\B-cos-main\training\training_utils.py", line 17, in start_training
training_loop(params, get_model, get_optimizer)
File "D:\1.Study\PycharmProjects\Reproduce\B-cos-main\training\training_utils.py", line 83, in training_loop
data_handler = Data(params.dataset_name, rank=ddp_rank,
File "D:\1.Study\PycharmProjects\Reproduce\B-cos-main\data\data_handler.py", line 82, in init
self.train_data_loader = self.init_data_loader(train=True,
File "D:\1.Study\PycharmProjects\Reproduce\B-cos-main\data\data_handler.py", line 105, in init_data_loader
data = Data.datasets[self.dataset_name](self.data_path, train=train, download=False,
File "D:\1.Study\PycharmProjects\Reproduce\B-cos-main\data\datasets.py", line 34, in init
path = os.path.join(root, self.base_folder, "train" if train else "val")
File "D:\Software\anaconda3\lib\ntpath.py", line 78, in join
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
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.