INNER CODE UNIT · Python
cur_iters
pprp/SimpleCVReproduction · NAS/AngleNAS/FairNAS/shrinking/main.py:104
cur_iters = (config.first_stage_epochs + (start_iter-1)*config.other_stage_epochs)*per_epoch_iters if start_iter > 0 else 0
for _ in range(cur_iters):
if scheduler.get_lr()[0] > args.min_lr:
scheduler.step()
print('resume from iters={}'.format(cur_iters))
# Save the base weights for computing angle
if start_iter == 0 and args.local_rank == 0:
torch.save(model.module.state_dict(), config.initial_net_cache)
print('save base weights ...')
for i in range(start_iter, iters):
print('search space size: {}'.format(get_search_space_size(operations)))
# ABS finishes when the size of search space is less than the threshold
if get_search_space_size(operations) <= config.shrinking_finish_threshold:
# save the shrunk search space
pickle.dump(operations, open(args.operations_path, 'wb'))
break