Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/train/Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def check_batch_size (self, batch_size) :
tmpe = np.load(os.path.join(ii, "coord.npy")).astype(global_ener_float_precision)
else:
tmpe = np.load(os.path.join(ii, "coord.npy")).astype(global_np_float_precision)
if tmpe.ndim == 1:
tmpe = tmpe.reshape([1,-1])
if tmpe.shape[0] < batch_size :
return ii, tmpe.shape[0]
return None
Expand All @@ -106,6 +108,8 @@ def check_test_size (self, test_size) :
tmpe = np.load(os.path.join(self.test_dir, "coord.npy")).astype(global_ener_float_precision)
else:
tmpe = np.load(os.path.join(self.test_dir, "coord.npy")).astype(global_np_float_precision)
if tmpe.ndim == 1:
tmpe = tmpe.reshape([1,-1])
if tmpe.shape[0] < test_size :
return self.test_dir, tmpe.shape[0]
else :
Expand Down Expand Up @@ -271,6 +275,8 @@ def _load_set(self, set_name) :
coord = np.load(path).astype(global_ener_float_precision)
else:
coord = np.load(path).astype(global_np_float_precision)
if coord.ndim == 1:
coord = coord.reshape([1,-1])
nframes = coord.shape[0]
assert(coord.shape[1] == self.data_dict['coord']['ndof'] * self.natoms)
# load keys
Expand Down