deepmd.tf.train.trainer
Module Contents
Classes
Generate an OP that loads the training data from the given DeepmdDataSystem. |
Functions
|
Attributes
- class deepmd.tf.train.trainer.DPTrainer(jdata, run_opt, is_compress=False)[source]
-
- static print_on_training(fp, train_results, valid_results, cur_batch, cur_lr, multi_task_mode=False, cur_lr_dict=None)[source]
- _init_from_pretrained_model(data, origin_type_map=None, bias_adjust_mode='change-by-statistic')[source]
Init the embedding net variables with the given frozen model.
- Parameters:
- data
DeepmdDataSystem
The training data.
- origin_type_map
list
The original type_map in dataset, they are targets to change the energy bias.
- bias_adjust_mode
str
The mode for changing energy bias : [‘change-by-statistic’, ‘set-by-statistic’] ‘change-by-statistic’ : perform predictions on energies of target dataset,
and do least sqaure on the errors to obtain the target shift as bias.
‘set-by-statistic’ : directly use the statistic energy bias in the target dataset.
- data
- class deepmd.tf.train.trainer.DatasetLoader(train_data: deepmd.tf.utils.data_system.DeepmdDataSystem)[source]
Generate an OP that loads the training data from the given DeepmdDataSystem.
It can be used to load the training data in the training process, so there is no waiting time between training steps.
- Parameters:
- train_data
DeepmdDataSystem
The training data.
- train_data
Examples
>>> loader = DatasetLoader(train_data) >>> data_op = loader.build() >>> with tf.Session() as sess: >>> data_list = sess.run(data_op) >>> data_dict = loader.get_data_dict(data_list)
- get_data_dict(batch_list: List[numpy.ndarray]) Dict[str, numpy.ndarray] [source]
Generate a dict of the loaded data.
- Parameters:
- batch_list
List
[np.ndarray
] The loaded data.
- batch_list
- Returns:
Dict
[str
,np.ndarray
]The dict of the loaded data.