<jupyter_start><jupyter_text>Algorithm1  get_channel_mask show<jupyter_code>def get_weights(model):
    return model.module.lmask.get_channel_mask()
#     return model.module.lmask.mask
exp_root = '/data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/'
analysis_queue = [
    'TwoStep_Algorithm1_Clip_L11e_3_LimitChannelClass',
    'TwoStep_Algorithm1_Clip_L1_LimitChannelClass',
    'TwoStep_Algorithm1_Clip_L21_LimitChannelClass',
    'TwoStep_Algorithm1_Clip_Lmax_LimitChannelClass',
]
analysis_queue = [exp_root+var for var in analysis_queue]
for item in analysis_queue:
    show_res(item)<jupyter_output>Successfully Load Model:  /data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/TwoStep_Algorithm1_Clip_L11e_3_LimitChannelClass/saved_model.pt
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[97%]val top1 Acc:0.9065<jupyter_text>Show self.mask instead of sigmoid(self.mask)<jupyter_code>def get_weights(model):
#     return model.module.lmask.get_channel_mask()
    return model.module.lmask.mask
exp_root = '/data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/'
analysis_queue = [
    'TwoStep_Algorithm1_Clip_L11e_3_LimitChannelClass',
    'TwoStep_Algorithm1_Clip_L1_LimitChannelClass',
    'TwoStep_Algorithm1_Clip_L21_LimitChannelClass',
    'TwoStep_Algorithm1_Clip_Lmax_LimitChannelClass',
]
analysis_queue = [exp_root+var for var in analysis_queue]
for item in analysis_queue:
    show_res(item)<jupyter_output>Successfully Load Model:  /data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/TwoStep_Algorithm1_Clip_L11e_3_LimitChannelClass/saved_model.pt
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[97%]val top1 Acc:0.9065<jupyter_text>Algorithm2<jupyter_code>def get_weights(model):
    return model.module.lmask.mask
    def get_channel_mask(c_mask):
        delta_scale = 1
        c_mask = torch.sigmoid(c_mask/delta_scale)
        return c_mask
#     return model.module.lmask.get_channel_mask()
    return get_channel_mask(model.module.lmask.mask)

exp_root = '/data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/alg2_8_22/'
analysis_queue = [
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L1',
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L21',
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_Lmax',
    'TwoStep_Algorithm2_Sigmoid10_L1',
    'TwoStep_Algorithm2_Sigmoid10_Lmax',
    
    'TwoStep_Algorithm2_Sigmoid1e-3_L21',
    'TwoStep_Algorithm2_Sigmoid0.1_L1',
    'TwoStep_Algorithm2_Sigmoid0.1_L12',
]
analysis_queue = [exp_root+var for var in analysis_queue]
for item in analysis_queue:
    show_res(item)
def get_weights(model):
    return model.module.lmask.get_channel_mask()
#     def get_channel_mask(c_mask):
#         delta_scale = 1
#         c_mask = torch.sigmoid(c_mask/delta_scale)
#         return c_mask
#     return get_channel_mask(model.module.lmask.mask)

exp_root = '/data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/alg2_8_22/'
analysis_queue = [
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L1',
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L21',
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_Lmax',
    'TwoStep_Algorithm2_Sigmoid10_L1',
    'TwoStep_Algorithm2_Sigmoid10_Lmax',
    
    'TwoStep_Algorithm2_Sigmoid1e-3_L21',
    'TwoStep_Algorithm2_Sigmoid0.1_L1',
    'TwoStep_Algorithm2_Sigmoid0.1_L12',
]
analysis_queue = [exp_root+var for var in analysis_queue]
for item in analysis_queue:
    show_res(item)<jupyter_output>Successfully Load Model:  /data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/alg2_8_22/TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L1/saved_model.pt
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[97%]val top1 Acc:0.9078<jupyter_text>Different Sigmoid Function<jupyter_code>def get_weights(model):
    def get_channel_mask(c_mask):
        delta_scale = 1
        c_mask = torch.sigmoid(c_mask/delta_scale)
        return c_mask
#     return model.module.lmask.get_channel_mask()
    return get_channel_mask(model.module.lmask.mask)

exp_root = '/data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/alg2_8_22/'
analysis_queue = [
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L1',
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L21',
    'TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_Lmax',
    'TwoStep_Algorithm2_Sigmoid10_L1',
    'TwoStep_Algorithm2_Sigmoid10_Lmax',
    
    'TwoStep_Algorithm2_Sigmoid1e-3_L21',
    'TwoStep_Algorithm2_Sigmoid0.1_L1',
    'TwoStep_Algorithm2_Sigmoid0.1_L12',
]
analysis_queue = [exp_root+var for var in analysis_queue]
for item in analysis_queue:
    show_res(item, run_model = False)<jupyter_output>Successfully Load Model:  /data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/reproduce_8_20/alg2_8_22/TwoStep_Algorithm2_Alg1Pretrain_Sigmoid10_L1/saved_model.pt<jupyter_text>Model Weights Analysis<jupyter_code>model_path = analysis_queue[0] + '/saved_model.pt'
model = resnet_cifar(depth=args_depth, num_classes=num_classes)
model = model.cuda()
model = torch.nn.DataParallel(model)
model.load_state_dict(torch.load(model_path))
w = model.module.lmask.get_channel_mask()
w.shape
w
w = model.module.lmask.mask
def get_channel_mask(c_mask):
    delta_scale = 1
    c_mask = torch.sigmoid(c_mask/delta_scale)
    return c_mask
w = get_channel_mask(w)
w<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1383740135804735, 'fraction_numerical': 0.04110846026793907, 'mean_word_length': 6.4555403556771545, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 305, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '185286', 'license': 'MIT', 'n_tokens_mistral': 2276, 'n_tokens_neox': 2103, 'n_words': 215, 'path': 'Official_Model_For_Paper/Model_Analysis/Baseline_Algorithms/Analysis_ConfusionMatrix_8_28.ipynb', 'repo_name': 'hyliang96/ICNN', 'size': '5449'}