Coder Social home page Coder Social logo

Comments (6)

yaoyao-liu avatar yaoyao-liu commented on May 28, 2024

Thanks for your interest in our work.

We use the same seed (1993) to generate the class order and use different seeds to run the following parts of the experiments.

from class-incremental-learning.

daihu-ye avatar daihu-ye commented on May 28, 2024

I don't understand.The seed is used to generate the class order in your code,3 different seeds mean 3 class order,right?
I just run
python main.py --nb_cl_fg=50 --nb_cl=10 --gpu=0 --random_seed=1993 --baseline=lucir --branch_mode=dual --branch_1=ss --branch_2=free --dataset=cifar100
python main.py --nb_cl_fg=50 --nb_cl=10 --gpu=0 --random_seed=1994 --baseline=lucir --branch_mode=dual --branch_1=ss --branch_2=free --dataset=cifar100
python main.py --nb_cl_fg=50 --nb_cl=10 --gpu=0 --random_seed=1996 --baseline=lucir --branch_mode=dual --branch_1=ss --branch_2=free --dataset=cifar100
Then I calulate averages ± standard deviations.The results is the final average accuracy when N=5. Is it right?
I also did some experiments and found that different seeds may affect the final accuracy(sometimes more than 1%).
And in icarl experiments,with AANets,i can't get the same results as your paper (your paper report 64.22 when N=5),but i only got 62.

from class-incremental-learning.

yaoyao-liu avatar yaoyao-liu commented on May 28, 2024

You need to edit this function to run experiments with the same class order and different random seeds:

def init_class_order(self):
"""The function to initialize the class order.
Returns:
order: an array for the class order
order_list: a list for the class order
"""
# Set the random seed according to the config
np.random.seed(self.args.random_seed)
# Set the name for the class order file
order_name = osp.join(self.save_path, "seed_{}_{}_order.pkl".format(self.args.random_seed, self.args.dataset))
# Print the name for the class order file
print("Order name:{}".format(order_name))
if osp.exists(order_name):
# If we have already generated the class order file, load it
print("Loading the saved class order")
order = utils.misc.unpickle(order_name)
else:
# If we don't have the class order file, generate a new one
print("Generating a new class order")
order = np.arange(self.args.num_classes)
np.random.shuffle(order)
utils.misc.savepickle(order, order_name)
# Transfer the array to a list
order_list = list(order)
# Print the class order
print(order_list)
return order, order_list

I'll check the results of iCaRL+AANets. Could you please send me the command you use to run iCaRL+AANets?

from class-incremental-learning.

daihu-ye avatar daihu-ye commented on May 28, 2024

Thanks for your explanation.Just edit the path of the class order file,let it lead to the same class order file (seed 1993 generate ).
It seems that the random seed is only used for selecting the exemplars in
https://github.com/yaoyao-liu/class-incremental-learning/blob/main/adaptive-aggregation-networks/trainer/base_trainer.py
in function gen_balanced_loader
the_idx = np.random.randint(0,len(X_train_this_step),size=self.args.nb_cl*self.args.nb_protos)
if we already get the class order file ,right?

from class-incremental-learning.

yaoyao-liu avatar yaoyao-liu commented on May 28, 2024

I think the random seed will influence many steps in the following code.

from class-incremental-learning.

daihu-ye avatar daihu-ye commented on May 28, 2024

Maybe i should run the experiments again.The result is actually got by 3 class orders ,it may influence the final accuracy.
Thanks for your response.

from class-incremental-learning.

Related Issues (20)

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.