Code Monkey home page Code Monkey logo

maximally_interfered_retrieval's People

Contributors

eugenium avatar optimass avatar pclucas14 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  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  avatar  avatar  avatar  avatar  avatar

maximally_interfered_retrieval's Issues

buffer.py throws error

While running the following:

python er_main.py --method mir_replay --dataset split_cifar10 --mem_size 50

the following error occurs:

Traceback (most recent call last):
  File "er_main.py", line 178, in <module>
    buffer.add_reservoir(data, target, None, task)
  File "/raid/joseph/Maximally_Interfered_Retrieval/buffer.py", line 130, in add_reservoir
    assert idx_buffer.max() < self.bx.size(0), pdb.set_trace()
RuntimeError: invalid argument 1: cannot perform reduction function max on tensor with no elements because the operation does not have an identity at /opt/conda/conda-bld/pytorch_1579022060824/work/aten/src/THC/generic/THCTensorMathReduce.cu:85

Reason is because idx_buffer is coming as empty, Please see this image:
Screenshot 2020-04-16 at 5 27 49 PM

PyTorch version: 1.4.0

Result on CIFAR-10

Hi. Thanks for sharing your code.
I tested ER-MIR with 100 memories per class on Cifar10 several times, but get highest average accuracy of 0.454 +/- 0.018, lower than the accuracy of 0.476 +/- 0.011 in the original paper.
I didn't change the code, and I ran the code as described in Scripts/ER_experiments.sh. Is there any configurations that should be modified to reproduce your results? Thank you very much!

MiniImagenet results

Hi, did you run any experiments on MiniImagenet for either doing nothing (finetuning) or stationary data?
I ask because I am getting 8.4% accuracy for 1 epoch of stationary training (rises to 33.1% after 5 epochs), which is much lower than 15.4% for ER and 16.8% for MIR (1 epoch, 1 iteration, 10k total buffer size, running your code). I am wondering how this can be? And whether you observed anything similar.

Subsampling pipeline

Hi @optimass, thank you for your interesting work.

Just to clarify the sizes. For e.g. python er_main.py --method mir_replay --dataset split_cifar10 --mem_size 20 --subsample 50 --samples_per_task -1 --n_runs 5 --disc_iters 1 --suffix 'ER_MIR' this seems to be the flow:

  • Total buffer size: 20 * 10 classes = 200 samples (line)
  • Randomly sample 50 from the 200, from classes other than the current batch's 2 classes (line)
  • For MIR: get top buffer_batch_size=10 from the 50 samples, using MIR metric to rank (line). For plain ER: randomly get 10 from the 50.

Is this correct?
What is the purpose of sub-sampling 50 as opposed to ranking the top 10 from the full 200?

er_main.py line118

args.mem_size = args.mem_sizeargs.n_classes #convert from per class to total memory
or
args.buffer_size = args.mem_size
args.n_classes #convert from per class to total memory

epochs in er_main.py

Does disc_epochs make sense in er_main.py? Is the data being trained with only one epoch

Mini-ImageNet data

Hi,

Thanks for the nice work! Can you please upload the Mini-ImageNet data that were used with this repo.

It expects to be present at @eugenium 's /home. Link

Or, can you please share where I could download it from. This would help me maintain consistency with the reported results.

Thanks!
Joseph

Possible bug in the test accuracy calculation

Hi, I found a possible bug in the test accuracy calculation. For each task, you are averaging the accuracy across mini batches as the task accuracy.

LOG_temp['acc'] += [pred.eq(target.view_as(pred)).sum().item() / pred.size(0)]
LOG_temp['cls_loss'] += [loss.item()]
logging_per_task(wandb, LOG, run, mode, 'acc', task, task_t,
np.round(np.mean(LOG_temp['acc']),2))

This calculation is wrong when the total number of data is not divisible by the mini batch size. Please consider changing to counting the total correctly predicted samples per task and then divide it by the total number of test data in that task.

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.