humansensinglab / dfcil-hgr

[ICCV 2023] Data-Free Class-Incremental Hand Gesture Recognition
MIT License
12 stars 3 forks source link

Some Question about SVM Training #3

Open Larry2000error opened 5 months ago

Larry2000error commented 5 months ago

Hello, I have some questions regarding the SVM classifier training part of your work while I am replicating it. According to your code, you used a dataset named test.txt in addition to train.txt during SVM training. I would like to confirm if my understanding is correct. If I have misunderstood, could you please explain the definition of test_dataset in your provided code within save_classifier.py and save_classifier_mi.py, particularly why mode=trainval?

mode = 'test' + args.subset;
    # define dataset
    test_dataset = \
        getattr(
            importlib.import_module(
                '.' + args.dataset, package='datasets'), 
            'Dataset')(
                mode,
                args.split_type,
                cfg_data,
                cfg.transforms[mode],
                args.n_add_classes,
                args.n_known_classes,
                rm_global_scale=cfg.rm_global_scale,
                drop_seed=args.drop_seed,
    );        
    if args.subset == 'val' :
        extra_test_dataset = \
            getattr(
                importlib.import_module(
                    '.' + args.dataset, package='datasets'), 
                'Dataset')(
                    'testtrain',
                    args.split_type,
                    cfg_data,
                    cfg.transforms[mode],
                    args.n_add_classes,
                    args.n_known_classes,                   
                    rm_global_scale=cfg.rm_global_scale,
                    drop_seed=args.drop_seed,                    
        );            

        test_dataset.merge_dataset(extra_test_dataset);

The code above is from the file save_classifier.py.

shubhraaich commented 5 months ago

The code uses both the train/val splits for SVM fitting. This train/val split was generated from the original training subset to avoid overfitting in the neural net training. The split used depends on the choice of the subset in ['train', 'val', 'test'] that is defined in the dataset files here: https://github.com/humansensinglab/dfcil-hgr/blob/main/configs/datasets/

So, 'testtrain' for instance is the train split and 'testval' is the val split.