Deepchem中图卷积的输出 [英] Output of Graph Convolution in deepchem
问题描述
我正在使用
为分子
是一个列表,该列表仅在索引0处包含一个元素,该元素为 molecules [0]
。这意味着 dc.feat.graph_features.ConvMolFeaturizer()
中的 mols
将此图像作为输入并输出 mol_object
。
mol_object
的输出是什么,我怎么看它?显示它是一个数组,但看不到该数组的内容吗?
print(np.shape(mol_object) )
(1,)
print(type(mol_object))
< class'numpy.ndarray'>
print(mol_object)
[< deepchem.feat.mol_graphs.ConvMol对象位于0x7f96a68c6e48>]
如何检查或查看 [
为什么不看 ConvMol对象的源代码?
featurizer的输出返回一个ConvMol对象数组(每个对象一个) rdkit分子输入),例如deepchem.feat.mol_graphs.ConvMol,您实际上要检查的是数组的第一个元素mol_object [0]。
通过查看源代码,您可以了解包含有关分子的哪些信息,例如可以通过ConvMol.atom_features访问的原子特征,或者在您的情况下可以访问mol_object [ 0] .atom_features
I am using Deepchem to create features for the my GraphConvolution model as follows.
import deepchem as dc
from rdkit import Chem
import numpy as np
import pandas as pd
from rdkit.Chem import Draw
from rdkit.Chem.Draw import IPythonConsole
smile = 'O=C(C1=CC=C(C=C1)C(O)=O)O'
molecules = []
molecules.append(Chem.MolFromSmiles(smile))
featurizer = dc.feat.graph_features.ConvMolFeaturizer()
mol_object = featurizer.featurize(mols=molecules)
Now I want to know the output mol_object
. I know that dc.feat.graph_features.ConvMolFeaturizer()
returns an array object. But it actually does to the input.
So the featurizer.featurize(mols=molecules)
takes molecules
as input.
The molecules[0]
will print the following graph.
As molecules
is a list which contains only one element at index 0 which is molecules[0]
. That means that mols
in dc.feat.graph_features.ConvMolFeaturizer()
takes this image as input and outputs mol_object
.
What is this mol_object
output and how can I see it? Is shows that it is an array but I can not see the content of this array?
print(np.shape(mol_object))
(1,)
print(type(mol_object))
<class 'numpy.ndarray'>
print(mol_object)
[<deepchem.feat.mol_graphs.ConvMol object at 0x7f96a68c6e48>]
How do I inspect or see [<deepchem.feat.mol_graphs.ConvMol object at 0x7f96a68c6e48>]
?
Why not look at the source code for the ConvMol object?
The output of the featurizer returns an array of ConvMol objects (one for each rdkit molecule input) i.e. deepchem.feat.mol_graphs.ConvMol, what you actually want to inspect is the first element of the array, mol_object[0].
Looking at the source code you can then understand what information about the molecule is contained such as the atom features which can be accessed ConvMol.atom_features, or in your case mol_object[0].atom_features
这篇关于Deepchem中图卷积的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!