python test_ind.py
You can refer to test_trans.py
and test_ind.py
for example usages of our model.
Models
The models are implemented mainly in trans_model.py
(transductive) and ind_model.py
(inductive), with inheritance from base_model.py
. You might refer to the source files for detailed API documentation.
Prepare the data
Transductive learning
The input to the transductive model contains:
x
, the feature vectors of the training instances,y
, the one-hot labels of the training instances,graph
, adict
in the format{index: [index_of_neighbor_nodes]}
, where the neighbor nodes are organized as a list. The current version only supports binary graphs.
Let L be the number of training instances. The indices in graph
from 0 to L - 1 must correspond to the training instances, with the same order as in x
.
Inductive learning
The input to the inductive model contains:
x
, the feature vectors of the labeled training instances,y
, the one-hot labels of the labeled training instances,allx
, the feature vectors of both labeled and unlabeled training instances (a superset ofx
),graph
, adict
in the format{index: [index_of_neighbor_nodes]}.
Let n be the number of both labeled and unlabeled training instances. These n instances should be indexed from 0 to n - 1 in graph
with the same order as in allx
.
Preprocessed datasets
Datasets for Citeseet, Cora, and Pubmed are available in the directory data
, in a preprocessed format stored as numpy/scipy files.
The dataset for DIEL is available at http://www.cs.cmu.edu/~lbing/data/emnlp-15-diel/emnlp-15-diel.tar.gz. We also provide a much more succinct version of the dataset that only contains necessary files and some (not very well-organized) pre-processing code here at http://cs.cmu.edu/~zhiliny/data/diel_data.tar.gz.
The NELL dataset can be found here at http://www.cs.cmu.edu/~zhiliny/data/nell_data.tar.gz.
In addition to x
, y
, allx
, and graph
as described above, the preprocessed datasets also include:
tx
, the feature vectors of the test instances,ty
, the one-hot labels of the test instances,test.index
, the indices of test instances ingraph
, for the inductive setting,ally
, the labels for instances inallx
.
The indices of test instances in graph
for the transductive setting are from #x
to #x + #tx - 1
, with the same order as in tx
.
You can use cPickle.load(open(filename))
to load the numpy/scipy objects x
, y
, tx
, ty
, allx
, ally
, and graph
. test.index
is stored as a text file.
Hyper-parameter tuning
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Python工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Python开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注Python)
件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新**
如果你觉得这些内容对你有帮助,可以扫码获取!!!(备注Python)