Coder Social home page Coder Social logo

essentials_for_cil's People

Contributors

sud0301 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

Watchers

 avatar  avatar  avatar  avatar

essentials_for_cil's Issues

How to get the results of CCIL+H-Aug ?

I expect to get the result of CCIL+H-Aug 71.66, but I get 68.25.

I conduct the following command

python main_cifar.py  \
        --new-classes 10 \
        --start-classes 50 \
        --cosine \
        --kd \
        --w-kd 1 \
        --epochs 120 \
        --exp-name 'kd_ep120_50_5' \
        --save \
        --num-sd 0\
        --aug  

Results:
[79.56, 74.01666666666667, 69.98571428571428, 65.1375, 61.63333333333333, 59.16]
Avg accuracy: 68.24886904761904

Do I miss some details?

Expect your reply. Thanks

About icarl_construct_exemplar_set function

Hi, I think the following codes seem not proper:

exemplar_set = []
exemplar_features = [] # list of Variables of shape (feature_size,)
exemplar_dist = []
for k in range(int(m)):
S = np.sum(exemplar_features, axis=0)
phi = features
mu = class_mean
mu_p = 1.0/(k+1) * (phi + S)
mu_p = mu_p / np.linalg.norm(mu_p)
dist = np.sqrt(np.sum((mu - mu_p) ** 2, axis=1))
idx = np.random.randint(0, features.shape[0])
exemplar_dist.append(dist[idx])
exemplar_set.append(images[idx])
exemplar_features.append(features[idx])
features[idx, :] = 0.0

After debugging I find that when features[idx, :] = 0.0 implemented, exemplar_features is also set to 0, thus S is always full of 0 at any time, making it meaningless. I am not sure whether it is a common problem or it is triggered due to my incompatible version of packages.
Besides, what if the random saving strategy get the same index? Is it right the purpose of setting the corresponding feature to 0, so that in the next phase the repetitive sample has a large distance and will be deleted? But still, what if class_mean itself is close to 0?

About the way you read image

In 'main_imagenet.py' , line 321:

x = Variable(transform(Image.fromarray(img))).cuda()

You use Image.fromarray(img) to load a array type image object. However, channel order in img is BGR (opencv) while the channel order in Image is RGB, which means this operation will confuse the channel order.

关于最后fc层

你好,请问你尝试使用常规fc层做实验而非cosinelinear吗?如果尝试过,在论文算法下,两种分类器对比怎么样?

还有在使用cosinelinear分类器,我训练自己数据集,发现sigma固定增加,模型很快(10个epoch样子)就达到最佳,继续性能就会降得很快,你在训练中是否有该现象。

someting wrong when create exemplar_set?

==> Current Class: [50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
==> Building model..
in_features: 512 out_features: 50
current net output dim: 60
old net output dim: 50
[50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
Constructing exemplar set for class-50...
exemplar set shape: 33
Done
Constructing exemplar set for class-51...
exemplar set shape: 33
Done
Constructing exemplar set for class-52...
exemplar set shape: 33
Done
Constructing exemplar set for class-53...
exemplar set shape: 33
Done
Constructing exemplar set for class-54...
exemplar set shape: 33
Done
Constructing exemplar set for class-55...
exemplar set shape: 33
Done
Constructing exemplar set for class-56...
exemplar set shape: 33
Done
Constructing exemplar set for class-57...
exemplar set shape: 33
Done
Constructing exemplar set for class-58...
exemplar set shape: 33
Done
Constructing exemplar set for class-59...
exemplar set shape: 33
Done
start self-distillation for original model.....
setting optimizer and scheduler.................
Traceback (most recent call last):
File "main_imagenet.py", line 472, in
train(model=net, old_model=old_net, epoch=args.epochs, optimizer=optimizer, scheduler=scheduler, lamda=args.lamda, train_loader=trainLoader, use_sd=False, checkPoint=50)
File "main_imagenet.py", line 151, in train
exemplar_set = ExemplarDataset(exemplar_sets, transform=transform_ori)
File "/home/ubuntu/Desktop/Alex/IL/essentials_for_CIL/data/data_loader_imagenet.py", line 17, in init
self.data = np.concatenate(data, axis=0)
File "<array_function internals>", line 6, in concatenate
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 4 dimension(s) and the array at index 1 has 1 dimension(s)

Which version of ImageNet is used?

Hi Sudhanshu,

Thank you for your nice work and codebase.

If possible, can you please share the version of ImageNet 1000 that you have used? Is it ImageNet 2017? If you have the download link handy, it would be very helpful if you could share them.

Thanks!

How many gigabytes of RAM did you use?

I am currently using 128 gigabytes of RAM, but out of memory comes out when I train with Imagenet. How many gigabytes of ram did you experiment with?

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.