跳至主要内容

dpgen transfer learning

结合 DP还能干这个?——transfer learning应用之D3修正 - 知乎 (zhihu.com)

博文:修改 (blogger.com)

/work/qan/kluo/Mg/dpgen/TransLnt50/simplify.json

{

     "type_map": ["Mg"],
     "mass_map": [24.305],
     "init_data_prefix": "",
     "init_data_sys":  [],
     "pick_data":  "/work/qan/kluo/Mg/dpgen/TLRun/collect",
     
     "labeled": false,
     "init_pick_number":100,
     "iter_pick_number":2000,
     "model_devi_f_trust_lo":0.05,
     "model_devi_f_trust_hi":0.2,
     
     "sys_configs": [],
     "sys_batch_size": ["auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto","auto"],
     "_sys_batch_size": [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
     "training_iter0_model_path":  ["/work/qan/kluo/Mg/dpgen/TLRun/iter.000087/00.train/00[0-3]"],
     "training_init_model": true,
     "numb_models": 4,
     "dp_compress": true,
     "default_training_param": {
        "model": {
            "type_map": ["Mg"],
            "descriptor": {
                "type": "se_e2_a",
                "sel": [80],
# or "sel": "auto:1.01" 如果需要初始化旧模型(transferL),这个必须用旧模型的确定值,不能用自动挡。
                "rcut_smth": 2.0,
                "rcut": 6.0,
                "neuron": [20,40,80],
                "resnet_dt": false,
                "axis_neuron": 12,
                "trainable":   false,
                "seed": 0
            },
             "fitting_net": {
                "neuron": [120,120,120],
                "resnet_dt": true,
                "trainable":   [false, false, false, true],
                "seed": 1
            }
        },
         "learning_rate": {
             "type": "exp",
             "start_lr": 0.001,
             "stop_lr": 3.51e-8,
             "decay_steps": 10000
         },
         "loss": {
             "type":         "ener",
             "start_pref_e": 0.02,
             "limit_pref_e": 1,
             "start_pref_f": 1000,
             "limit_pref_f": 1,
             "start_pref_v": 0.02,
             "limit_pref_v": 1
         },
         "training": {
             "_validation_data":{
             "systems": [
             "/work/qan/kluo/Mg/dpgen/iter.000059/02.fp/data.029"],

        "batch_size":   "auto",
        "numb_btch":    4,
        "_comment":     "that's all"
    },
         "stop_batch": 2000000,
         "_seed": 1,
         "disp_file": "lcurve.out",
         "disp_freq": 5000,
         "numb_test": 2,
         "save_freq": 100000,
         "save_ckpt": "model.ckpt",
         "disp_training": true,
         "time_training": true,
         "profiling": false,
         "profiling_file": "timeline.json",
         "_comment": "that's all"
         }
     },
 
     "fp_style": "vasp",
     "_fp_skip_bad_box":  "true",
     "fp_task_max": 2000,
     "fp_task_min": 0,
     "ratio_failed": 1.0,
     "_fp_accurate_threshold": 0.99,
     "_fp_accurate_soft_threshold": 0.01,
     "fp_pp_path": "./",
     "fp_pp_files": ["POTCAR_Mg"],
     "fp_incar": "./INCAR_Mg",
     "_comment": "that's all"
}


/work/qan/kluo/Mg/dpgen/TransLnt50/machine.json

{
    "api_version": "1.0",
    "_deepmd_version": "2.0.3",
    "train" :[
        {
            "command": "dp",
            "machine": {
                "batch_type": "slurm",
                "context_type": "local",
                "local_root" : "./",
                "remote_root": "./work"
            },
            "resources": {
                "number_node": 1,
                "cpu_per_node": 64,
                "gpu_per_node": 0,
                                "queue_name": "nova,reserved,instruction,interactive,scavenger",
                                "custom_flags": ["###SBATCH --account=cpu-s1-matersimul-0",
                                "#SBATCH --job-name='dptrain'",
                                "#SBATCH --cpus-per-task=1",
                                "#SBATCH --hint=compute_bound",
                                "#SBATCH --ntasks=64",
                                "#SBATCH --mail-type=ALL",
                                "#SBATCH --time=24:00:00",
                                "#SBATCH --exclusive",
                                "#SBATCH --mem=0",
                                "#SBATCH --exclude=nova18-gpu-[1-5],nova21-gpu-[1-15],nova22-gpu-[1-5]",
                                "#SBATCH --mail-user=kluo@iastate.edu"],
                                "source_list": ["/work/qan/kluo/TiCdpgen/Run/dp221.sh"],
                                "_module_list": ["intel/mkl/64/2019/5.281", "intel/mpi/64/2019/5.281"],
                                "_time_limit": "240:0:0",
                                "group_size": 1
            }
        }
    ],
    "model_devi":[
        {
            "command": "dp",
            "machine": {
                "batch_type": "slurm",
                "context_type": "local",
                "local_root" : "./",
                "remote_root": "./work"
            },
            "resources": {
                                "number_node": 1,
                                "cpu_per_node": 64,
                                "gpu_per_node": 0,
                                "queue_name": "nova,reserved,instruction,interactive,scavenger",
                                "custom_flags": ["###SBATCH --account=cpu-s1-matersimul-0",
                                "#SBATCH --job-name='dpdevi'",
                                "#SBATCH --cpus-per-task=1",
                                "#SBATCH --hint=compute_bound",
                                "#SBATCH --ntasks=64",
                                "#SBATCH --exclusive",
                                "#SBATCH --mem=0",
                                "##SBATCH --nodelist=nova18-[1-70]",
                                "#SBATCH --exclude=nova18-gpu-[1-5],nova21-gpu-[1-15],nova22-gpu-[1-5]",
                                "#SBATCH --time=1:00:00"],
                                "source_list": ["/work/qan/kluo/TiCdpgen/Run/lmp227.sh"],
                                "_module_list": ["intel/mkl/64/2019/5.281", "intel/mpi/64/2019/5.281"],
                                "_time_limit": "240:0:0",
                                "wait_time": 1,
                                "group_size": 1
                        }
        }
    ],
    "fp":[
        {
            "command": "python /work/qan/kluo/Mg/CDFTpython/elect.py ./ --name Mg --count 2 --nt 50 --ncore 18 && srun -n 18 /work/qan/codes/VASP/bin/vasp_std1",
            "machine": {
                                "batch_type": "slurm",
                                "context_type": "local",
                                "local_root" : "./",
                                "remote_root": "./work"
                        },
                        "resources": {
                                "number_node": 1,
                                "cpu_per_node": 18,
                                "gpu_per_node": 0,
                                "queue_name": "nova,reserved,instruction,interactive,scavenger",
                                "custom_flags": ["#SBATCH --constraint=intel",
                                "#SBATCH --job-name='fp'",
                                "#SBATCH --cpus-per-task=1",
                                "#SBATCH --hint=compute_bound",
                                "#SBATCH --ntasks=18",
                                "##SBATCH --exclusive",
                                "##SBATCH --mem=0",
                                "#SBATCH --exclude=nova18-gpu-[1-5],nova21-gpu-[1-15],nova22-gpu-[1-5]",
                                "#SBATCH --time=2:00:00"],
                                "source_list": ["/home/kluo/shpy/dplmp.sh"],
                                "_module_list": ["intel/mkl/64/2019/5.281", "intel/mpi/64/2019/5.281"],
                                "_time_limit": "240:0:0",
                                "wait_time": 1,
                                "group_size": 1
                        }
        }
    ]
}

评论

此博客中的热门博文

lammps 压痕划痕模拟设置参考

  Molecular dynamics study on the effect of electric current on electrically-assisted scratching for crystal copper - IOPscience 原因深入分析如下: ✅ 切削 / 摩擦 / 划痕:局部剧烈变形 → 热量集中 这类过程模拟的是工具与材料 接触区域的强烈局部非平衡过程 ; 如果对整个系统控温,会 严重抹平局部发热、滑移带的应变能耗散 等重要现象; 所以 只在边界区域(如底部、侧边)设 thermostat,起到“热沉”作用 ; 文献经典设置就是: 底部固定 ; 边缘 slab 控温 ; 接触区完全不控温,自由演化 。 ✅ 拉伸 / 压缩 / 剪切:全局加载 → 热传导充分 是材料整体在受力,不存在特别“集中”的能量输入区域; 局部发热相对温和,且在 bulk 系统中可以通过自身结构进行导热 ; 实验中常常是等温加载(准静态过程); 所以 很多文献就直接用整体 fix nvt 控温 ,保持恒温环境,简化模拟; 注意有些更精细的研究会改为: 只在两端 slab 控温,中间 Newtonian 自由演化 。 📚 二、典型模拟场景下的控温策略总览 场景类别 控温方式 控温范围 控温方法 控温目的 注意事项 ✅ 平衡态热力学性质 (如热容、扩散、应力) 整体控温 全体系 fix nvt , fix npt 模拟室温等温状态 标准EMD方法 ✅ 热导率(Green-Kubo) 整体控温 全体系 fix nvt (前期平衡), 后期 nve 采集能流自相关函数 采样期不能控温 ✅ 热导率(NEMD) 区域控温 热源/热沉 fix langevin , fix heat 人为施加温差形成热流 中间区自由演化 ✅ 拉伸 / 压缩 / 剪切 整体控温(常用)或局部控温 全体系或上下 slab fix nvt 或 langevin slab 保持恒温,避免非真实升温 全控温可抹平热应变 ✅ 应力松弛 / 加热冷却过程 整体控温 全体系 fix nvt 或温度渐变 等温退火、升温或冷却 控温方式决定退火速率 ✅ 位错运动 / 缺陷扩散 局部控温 边界或部分 slab ...

lammps Pdamp,Tdamp的设置经验

 一张小抄(固体/位错/二维材料都适用) fix             11    all npt temp 0.1 0.1 0.5 tri 0.0 0.0 5   drag 2 tchain 3 pchain 3 保持 Pdamp ≫ Tdamp(通常 10× 左右)。 固体/低温:Tdamp 取 0.5–1 ps,Pdamp 取 5–15 ps;需要更稳就再加大 Pdamp。 所以推荐如下: 0.1K 用1 10 300K 固体 用0.5 5  高温用0.2 2 液体用0.1 1 液体/高温:Tdamp 0.2–0.5 ps,Pdamp 2–5 ps 往往够。 2D(石墨烯等,只控平面 x/y):Pdamp 常用 10–20 ps 起步,z 固定或 z NULL。 观察到体积/压力振荡大:增加 Pdamp 或加 drag 2–3,必要时把 dt 临时降到 0.5 fs。 drag 2、tchain/pchain 3 保留没坏处,确实能再抑制一点振荡;不是硬性必须,但在固体+低温+(可能还有 tri 或剪切)的组合里,“更稳”>“更快”,我一般会开着。

dpgen训练经验

最新的dpgen参考PtCuP /work/qan/kluo/PtCuP 0.1K的第0代采样很重要 可以多重复几次确保99以上的准确率,它是后续高温的基础 单点能计算  ISYM = 2 nohup dpgen run param.json machine.json 1>log 2>err& nohup dpgen init_bulk param.json machine.json  1>log 2>err& 初始数据集产生,只能一个POSCAR的计算 但是可以同时提多个任务,但是每个任务都需要 POTCAR POSCAR 一 一对应才行。  elements 和POSCAR POTCAR保持一致。 " type_map " : [ "Ti" , "C" , "V" , "Cr" , "Nb" , "Mo" ],都写全才行 POSCAR 不需要 改成特定顺序 程序最终生成数据集的时候会根据 type_map自动统一匹配 usage: dpgen [-h] {init_surf,init_bulk,auto_gen_param,init_reaction,run,run/report,collect,simplify,autotest,db,gui} ... dpgen is a convenient script that uses DeepGenerator to prepare initial data, drive DeepMDkit and analyze results. This script works based on several sub-commands with their own options. To see the options for the sub-commands, type "dpgen sub-command -h". positional arguments:   {init_surf,init_bulk,auto_gen_param,init_reaction,run,run/report,collect,simpli...