Ejemplo n.º 1
0
    if not os.path.exists(netdir):
        os.mkdir(netdir)

    nnfprefix = netdir + 'train'

    netdict = {
        'iptfile': iptfile,
        'cnstfile': cstfile,
        'saefile': saefile,
        'nnfprefix': netdir + 'train',
        'aevsize': aevsize,
        'num_nets': Nnets,
    }

    ## Train the ensemble ##
    aet = alt.alaniensembletrainer(netdir, netdict, 'train', h5stor, Nnets)
    aet.build_training_cache()
    aet.train_ensemble(GPU)
    exit(0)

    ldtdir = root_dir  # local data directories
    if not os.path.exists(root_dir + datdir + str(i + 1).zfill(2)):
        os.mkdir(root_dir + datdir + str(i + 1).zfill(2))

    ## Run active learning sampling ##
    acs = alt.alconformationalsampler(ldtdir, datdir + str(i + 1).zfill(2),
                                      optlfile, fpatoms, netdict)
    acs.run_sampling_cluster(gcmddict, GPU)
    acs.run_sampling_dimer(dmrparams, GPU)
    acs.run_sampling_nms(nmsparams, GPU)
    acs.run_sampling_md(mdsparams, perc=0.5, gpus=GPU)
Ejemplo n.º 2
0
import anialtools as alt

nwdir = '/home/jsmith48/scratch/ccsd_extrapolation/ccsd_train/tl_train_dhl_7/'
h5dir = '/home/jsmith48/scratch/ccsd_extrapolation/h5files/train/cmb/'

Nnets = 8  # networks in ensemble
Nblock = 16  # Number of blocks in split
Nbvald = 2  # number of valid blocks
Nbtest = 1  # number of test blocks

netdict = {
    'iptfile': nwdir + 'inputtrain.ipt',
    'cnstfile': nwdir + 'rHCNO-5.2R_16-3.5A_a4-8.params',
    'saefile': nwdir + 'sae_linfit.dat',
    'atomtyp': ['H', 'C', 'N', 'O']
}

GPU = [2, 3, 4, 5]

## Train the ensemble ##
aet = alt.alaniensembletrainer(nwdir, netdict, h5dir, Nnets)
aet.build_strided_training_cache(Nblock,
                                 Nbvald,
                                 Nbtest,
                                 build_test=False,
                                 forces=False)
aet.train_ensemble(GPU)
Ejemplo n.º 3
0
    except FileExistsError:
        pass
    try:
        os.mkdir(new_datdir)
    except FileExistsError:
        pass

    netdict = {
        'iptfile': iptfile_path,
        'cnstfile': cstfile_path,
        'saefile': saefile_path,
        'nnfprefix': nnfprefix,
        'aevsize': aevsize,
        'num_nets': Nnets,
        'atomtyp': ['H', 'C', 'N', 'O']
    }
    # Train the ensemble
    ani_ensemble_trainer = alt.alaniensembletrainer(netdir, netdict,
                                                    h5dataset_path, Nnets)
    ani_ensemble_trainer.build_strided_training_cache(Nblock, Nbvald, Nbtest,
                                                      False)
    ani_ensemble_trainer.train_ensemble(GPU)
    local_data_dir = root_dir
    # Run active learning sampling
    ani_conformational_sampler = alt.alconformationalsampler(
        local_data_dir, dat, optlfile_path, fpatoms, netdict)
    ani_conformational_sampler.run_sampling_dhl(dhparams, gpus=GPU + GPU)
    # Submit jobs, return and pack data
    aniserver.generateQMdata(hostname, username, swkdir, local_data_dir, dat,
                             h5dataset_path, mae, jtime)