Hi Stackoverflow community,
I have recently started to work with deepmd-kit and I have a question about dpdata. I was following tutorial steps in the website below;
https://tutorials.deepmodeling.com/en/latest/Tutorials/DeePMD-kit/learnDoc/Handson-Tutorial%28v2.0.3%29.html
I have my data converted into numpy format and stored in deepmd_data directory; box.npy, coord.npy, force.npy, energy.npy, virial.npy. After running the following python script, I got ONLY box and coord data split meaning they were the only files in training_data and validation_data directories. If anyone every encountered such problem could you please help me with that? How to get the rest of the data split and stored in necessary directories?
Thank you!
import dpdata
import numpy as np
#importing all the numpy data in the directory
data=dpdata.System('deepmd_data', fmt='deepmd/npy')
print('# the data contains %d frames' % len(data))
#random choice 50 index for validation data
rng=np.random.default_rng() #random number generator
index_validation=rng.choice(150, size=50, replace=False)
#setting the rest of the indexes for training data
index_training=list(set(range(150))-set(index_validation))
#Creating subsystems
data_training=data.sub_system(index_training)
data_validation=data.sub_system(index_validation)
#locating the data
data_training.to_deepmd_npy('./data/training_data')
data_validation.to_deepmd_npy('./data/validation_data')
print('# the training data contains %d frames' % len(data_training))
print('# the validation data contains %d frames'% len(data_validation))
Bicha Azizova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.