import yaml

def save_cfg_YeastBP():
    configs = {'max_epoch': 500,
               'lr': 1e-3,
               'threshold': 0.8}
    
    return configs

def save_cfg_YeastCC():
    configs = {'max_epoch': 500,
               'lr': 1e-3,
               'threshold': 0.8}
    
    return configs

def save_cfg_YeastMF():
    configs = {'max_epoch': 500,
               'lr': 1e-3,
               'threshold': 0.9}
    
    return configs

def save_cfg_Music_emotion():
    configs = {'max_epoch': 500,
               'lr': 1e-3,
               'threshold': 0.6}
    
    return configs

def save_cfg_Music_style():
    configs = {'max_epoch': 500,
               'lr': 1e-3,
               'threshold': 0.6}
    
    return configs

# low-level noise
def save_cfg_yeast_low_level():
    configs = {'max_epoch': 500,
               'lr': 1e-3}
    
    return configs

def save_cfg_Corel16k001_low_level():
    configs = {'max_epoch': 200,
               'lr': 3e-3,
               'threshold': 0.8}
    
    return configs

def save_cfg_delicious_low_level():
    configs = {'max_epoch': 200,
               'lr': 3e-3}
    
    return configs

def save_cfg_iaprtc12_low_level():
    configs = {'max_epoch': 200,
               'lr': 1e-3}
    
    return configs

def save_cfg_espgame_low_level():
    configs = {'max_epoch': 200,
               'lr': 1e-3}
    
    return configs

def save_cfg_mediamill_low_level():
    configs = {'max_epoch': 500,
               'lr': 1e-3}
    
    return configs

# high-level noise
def save_cfg_yeast_high_level():
    configs = {'max_epoch': 500,
               'lr': 1e-3,
               'threshold': 0.6}
    
    return configs

def save_cfg_Corel16k001_high_level():
    configs = {'max_epoch': 200,
               'lr': 1e-3,
               'threshold': 0.8}
    
    return configs

def save_cfg_delicious_high_level():
    configs = {'max_epoch': 200,
               'lr': 1e-3,
               'threshold': 0.6}
    
    return configs

def save_cfg_iaprtc12_high_level():
    configs = {'max_epoch': 200,
               'lr': 1e-3}
    
    return configs

def save_cfg_espgame_high_level():
    configs = {'max_epoch': 200,
               'lr': 1e-3,
               'threshold': 0.6}
    
    return configs

def save_cfg_mediamill_high_level():
    configs = {'max_epoch': 500,
               'lr': 1e-3}
    
    return configs

if __name__ == '__main__':
    realworld_datasets = ["YeastBP", "YeastCC", "YeastMF", "Music_emotion", "Music_style"]
    syn_datasets = ["yeast", "Corel16k001", "delicious", "iaprtc12", "espgame", "mediamill"]
    for dataset in realworld_datasets: 
        filename = dataset + '_cfgs.yaml'
        func = 'save_cfg_' + dataset
        
        configs = eval(func)()
        
        with open(filename, "w", encoding="utf-8") as f:
            yaml.dump(configs, f)
    
    for dataset in syn_datasets:
        filename = dataset + '_low_level_cfgs.yaml'
        func = 'save_cfg_' + dataset + '_low_level'
        
        configs = eval(func)()
        
        with open(filename, "w", encoding="utf-8") as f:
            yaml.dump(configs, f)
            
    for dataset in syn_datasets:
        filename = dataset + '_high_level_cfgs.yaml'
        func = 'save_cfg_' + dataset + '_high_level'
        
        configs = eval(func)()
        
        with open(filename, "w", encoding="utf-8") as f:
            yaml.dump(configs, f)