INNER CODE UNIT · Python

per_stage_iters

pprp/SimpleCVReproduction · NAS/AngleNAS/SPOS/shrinking/main.py:147

        per_stage_iters = config.other_stage_epochs * \
            per_epoch_iters if i > 0 else config.first_stage_epochs * per_epoch_iters

        seed = train(train_dataprovider, optimizer, scheduler, model, criterion_smooth,
                     operations, i, per_stage_iters, seed, args)

        if args.local_rank == 0:
            # Start shrinking the search space
            load(base_model, config.initial_net_cache) # initial_net_cache='base_weight.pt'
            operations = ABS(base_model, model.module, operations, i)
            now = time.strftime('%Y-%m-%d %H:%M:%S',
                                time.localtime(time.time()))

            # Modify the base weights for only one time
            if not modify_initial_model and (i+1) * config.per_stage_drop_num > config.modify_initial_model_threshold:
                torch.save(model.module.state_dict(), config.initial_net_cache)
                modify_initial_model = True
                print('Modify base weights ...')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…