data.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:dtnn 作者: atomistic-machine-learning 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号