Exemplo n.º 1
0
import ANet
from ANet import ANet

A_model = ANet()
try:
    A_model.load_state_dict(torch.load(os.path.join(ROOT_DIR, 'multisource_cocktail/ANet/ANet_raw_2.pkl')))
except Exception as e:
    print(e, "A-model not available")
# print(A_model)


import conv_fc
from conv_fc import ResDAE

Res_model = ResDAE()
try:
    Res_model.load_state_dict(torch.load(os.path.join(ROOT_DIR, 'multisource_cocktail/DAE/DAE_multi_2.pkl')))
except Exception as e:
    print(e, "Res-model not available")
# print(Res_model)


# ============================================
# optimizer
# ============================================

criterion = nn.MSELoss()


# ============================================
                torch.load(
                    os.path.join(
                        ROOT_DIR,
                        'multisource_cocktail/ANet/ANet_multi_2_trained.pkl')))
        else:
            A_model.load_state_dict(
                torch.load(
                    os.path.join(ROOT_DIR,
                                 'multisource_cocktail/ANet/ANet_raw_2.pkl')))
    except Exception as e:
        print(e, "A-model not available")
    # print(A_model)

    from conv_fc import ResDAE

    Res_model = ResDAE()
    try:
        if ATTEND:
            Res_model.load_state_dict(
                torch.load(
                    os.path.join(ROOT_DIR,
                                 'multisource_cocktail/DAE/DAE_multi_2.pkl')))
        else:
            Res_model.load_state_dict(
                torch.load(
                    os.path.join(ROOT_DIR,
                                 'multisource_cocktail/DAE/DAE_raw_2.pkl')))
    except Exception as e:
        print(e, "Res-model not available")
    # print(Res_model)
Exemplo n.º 3
0
                    ROOT_DIR,
                    'multisource_cocktail/ANet/ANet_multi_2_trained.pkl')))
    except Exception as e:
        print(e, "A-model not available")
else:
    try:
        A_model.load_state_dict(
            torch.load(
                os.path.join(ROOT_DIR,
                             'multisource_cocktail/ANet/ANet_raw_2.pkl')))
    except Exception as e:
        print(e, "A-model not available")
# print(A_model)

from conv_fc import ResDAE
Res_model = ResDAE()
if reuse:
    try:
        Res_model.load_state_dict(
            torch.load(
                os.path.join(ROOT_DIR,
                             'multisource_cocktail/DAE/DAE_multi_2.pkl')))
    except Exception as e:
        print(e, "Res-model not available")
else:
    try:
        Res_model.load_state_dict(
            torch.load(
                os.path.join(ROOT_DIR,
                             'multisource_cocktail/DAE/DAE_multi_2.pkl')))
    except Exception as e: