示例#1
0
文件: main.py 项目: aglgit/python-md
    num_angular_etas = 11
    num_zetas = 1
    angular_type = "G4"
    trn = Trainer(
        convergence=convergence,
        force_coefficient=force_coefficient,
        overfit=overfit,
        cutoff=cutoff,
        hidden_layers=hidden_layers,
    )
    trn.create_Gs(elements, num_radial_etas, num_angular_etas, num_zetas,
                  angular_type)

    trjbd = TrajectoryBuilder()
    calc = OpenKIMcalculator("SW_StillingerWeber_1985_Si__MO_405512056662_005")
    train_atoms = trjbd.build_atoms(system, size, temp, calc)

    steps, train_traj = trjbd.integrate_atoms(train_atoms,
                                              train_traj,
                                              n_train,
                                              save_interval,
                                              timestep=timestep)
    steps, train_force_traj = trjbd.integrate_atoms(
        train_atoms,
        train_force_traj,
        n_train_force,
        save_interval,
        steps=steps,
        timestep=timestep,
    )
示例#2
0
    timestep = 1.0
    n_test = int(5e3)
    save_interval = 10
    legend = ["SW", "AMP"]

    energy_log = "energy-trained-log.txt"
    force_log = "force-trained-log.txt"
    energy_plot = system + "_" + "energy_log.png"
    force_plot = system + "_" + "force_log.png"
    plter = Plotter()
    plter.plot_trainlog(energy_log, energy_plot)
    plter.plot_trainlog(force_log, force_plot)

    trjbd = TrajectoryBuilder()
    calc = OpenKIMcalculator("SW_StillingerWeber_1985_Si__MO_405512056662_005")
    test_atoms = trjbd.build_atoms(system, size, temp, calc, seed=0)
    calc = Amp.load("calcs/force-trained.amp")
    amp_test_atoms = trjbd.build_atoms(system, size, temp, calc, seed=0)

    test_traj = "test.traj"
    steps, test_traj = trjbd.integrate_atoms(
        test_atoms, test_traj, n_test, save_interval, timestep=timestep, convert=True
    )

    amp_test_traj = "amp_test.traj"
    steps, amp_test_traj = trjbd.integrate_atoms(
        amp_test_atoms,
        amp_test_traj,
        n_test,
        save_interval,
        timestep=timestep,