Exemple #1
0
def main():
    from att_model_proxy import cmd_args
    seed = cmd_args.seed
    np.random.seed(seed)

    from att_model_proxy import AttMolProxy as ProxyModel
    from att_model_proxy import cmd_args

    model = ProxyModel()

    cal_valid_prior(model, cmd_args.latent_dim)
def main():
    seed = 10960817
    np.random.seed(seed)

    from att_model_proxy import AttMolProxy as ProxyModel
    from att_model_proxy import cmd_args

    model = ProxyModel()

    priors_file = cmd_args.save_dir + '/decoded_priors.txt'
    valid_prior = cal_valid_prior(model, cmd_args.latent_dim)
    save_decoded_priors(valid_prior, priors_file)
Exemple #3
0
def main():
    seed = 10960817
    np.random.seed(seed)

    from att_model_proxy import AttMolProxy as ProxyModel
    from att_model_proxy import cmd_args

    model = ProxyModel()

    generation_file = cmd_args.save_dir + '/decoded_generation.txt'
    result = cal_valid_prior(model, cmd_args.latent_dim)
    save_decoded_priors(result, generation_file)
Exemple #4
0
def main():
    seed = 10960817
    np.random.seed(seed)

    from att_model_proxy import AttMolProxy as ProxyModel
    from att_model_proxy import cmd_args

    model = ProxyModel()

    valid_prior = cal_valid_prior(model, cmd_args.latent_dim)

    valid_prior_save_file =  cmd_args.saved_model + '-valid_prior.txt'
    print('valid prior:', valid_prior)
    with open(valid_prior_save_file, 'w') as fout:
        print('valid prior:', valid_prior, file=fout)
def main():
    from att_model_proxy import AttMolProxy as ProxyModel
    from att_model_proxy import cmd_args
    # takes the model and calculate the decode results
    model = ProxyModel()
    # update where to save
    decoded_file = cmd_args.save_dir + '/decoded_results.txt'

    # reading smiles test set
    if cmd_args.smiles_file == 'qm9':
        smiles_list = readStr_qm9()
    elif cmd_args.smiles_file == 'zinc':
        smiles_list = read_zinc()

    XTE = smiles_list[0:nb_smiles]

    decoded_result = reconstruct(model, XTE)
    decoded_result = np.array(decoded_result)
    save_decoded_results(XTE, decoded_result, decoded_file)
Exemple #6
0
def main():
    from att_model_proxy import AttMolProxy as ProxyModel
    from att_model_proxy import cmd_args

    decode_result_save_file = cmd_args.saved_model + '-reconstruct_zinc_decode_result.csv'
    accuracy_save_file = cmd_args.saved_model + '-reconstruct_zinc_accuracy.txt'

    model = ProxyModel()

    decode_result = reconstruct(model, smiles)
    accuracy, junk = cal_accuracy(decode_result)

    print('accuracy:', accuracy, 'junk:', junk)

    save_result = True
    if save_result:
        with open(accuracy_save_file, 'w') as fout:
            print('accuracy:', accuracy, 'junk:', junk, file=fout)

        save_decode_result(decode_result, decode_result_save_file)