Author Topic: Error: Using pre-calculated data for TrainingSet for MTP training  (Read 2981 times)

0 Members and 1 Guest are viewing this topic.

Offline krabidix

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: fi
  • Reputation: 0
    • View Profile
Hi, I am using my pre-calculated data (BulkConfigurations) as the TrainingSet following: https://docs.quantumatk.com/manual/Types/TrainingSet/TrainingSet.html#trainingset-c The pre-calculated data was obtained using LCAO and saved in '.hdf5', files, there are a number of BulkConfigurations. When I am using following script:  
Code
import glob
import os
directory = ''

filenames= glob.glob(os.path.join(directory, 'data_*.hdf5'))


bulk_configurations = []


for filename in filenames:
    bulk_configurations.append(nlread(filename, BulkConfiguration)[0])
    
calculator = bulk_configurations[0].calculator()
training_set= TrainingSet(bulk_configurations, recalculate_training_data=False, calculator = calculator )
scan_over_non_linear_coefficients = scanOverNonLinearCoefficients(
    perform_optimization=False

# Moment Tensor Potential Training
moment_tensor_potential_training = MomentTensorPotentialTraining(
    filename='MTP.hdf5',
    object_id='mtp',
    training_sets= training_set, 
    calculator=calculator,  
    fitting_parameters_list=scan_over_non_linear_coefficients
)
moment_tensor_potential_training.update()
It gives the error: "training_sets miss data. Check that all required energy, forces, or stress data is provided.". The Bulkconfigurations are converged. What could be the possible solution to this error? Best, krabidix

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
As the error says, it's not enough to just have the configurations, you must also have the data to train to, i.e. energy, forces and stress.
Without having had the chance to test it explicitly, I think you just have to set recalculate_training_data=True instead of False, and I hope this will not rerun the scf loop since you do provide the same calculator as originally used.