def convert_atoms(self, row):
numbers = row.get('numbers')
positions = row.get('positions').astype(self.floatX)
pbc = row.get('pbc')
cell = row.get('cell').astype(self.floatX)
features = [numbers, positions, cell, pbc]
for k in list(self.kvp.keys()):
f = row[k]
if np.isscalar(f):
f = np.array([f])
if f.dtype in [np.float16, np.float32, np.float64]:
f = f.astype(self.floatX)
features.append(f)
for k in list(self.data.keys()):
f = np.array(row.data[k])
if np.isscalar(f):
f = np.array([f])
if f.dtype in [np.float16, np.float32, np.float64]:
f = f.astype(self.floatX)
features.append(f)
return features
评论列表
文章目录