from dgllife.utils import smiles_to_bigraph, CanonicalAtomFeaturizer, CanonicalBondFeaturizer怎么使用
时间: 2023-05-11 09:03:05 浏览: 102
这是一个关于DGLLife工具包的问题,可以回答。这个工具包提供了一些用于分子图神经网络的函数和类。其中,smiles_to_bigraph函数可以将SMILES字符串转换为DGL图,CanonicalAtomFeaturizer和CanonicalBondFeaturizer类可以用于对原子和键进行特征提取。使用方法可以参考DGLLife的官方文档。
相关问题
from openpyxl.utils import formula_to_value
As an AI language model, I cannot import modules or execute code. However, I can tell you that the `formula_to_value` function in the `openpyxl.utils` module is used to convert a formula in a cell to its resulting value. This can be useful when you want to extract the final result of a formula in a cell, rather than the formula itself.
from keras.utils import to_categorical的逆过程
The inverse process of `from keras.utils import to_categorical` is `np.argmax()` function from the NumPy library. It converts the one-hot encoded arrays (created using `to_categorical()`) back into numerical labels.
Example:
```python
import numpy as np
from keras.utils import to_categorical
# Create numerical labels
labels = np.array([0, 1, 2, 1, 0, 2])
# Convert numerical labels to one-hot encoded arrays
one_hot_labels = to_categorical(labels)
# Convert one-hot encoded arrays back to numerical labels
numerical_labels = np.argmax(one_hot_labels, axis=1)
print(numerical_labels) # Output: [0 1 2 1 0 2]
```