All Projects → haidfs → TransE

haidfs / TransE

Licence: other
TransE方法的Python实现,解释SGD中TransE的向量更新

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to TransE

NotEnoughAV1Encodes-Qt
Linux GUI for AV1 Encoders
Stars: ✭ 27 (-12.9%)
Mutual labels:  multiprocessing
python-graceful-shutdown
Example of a Python code that implements graceful shutdown while using asyncio, threading and multiprocessing
Stars: ✭ 109 (+251.61%)
Mutual labels:  multiprocessing
SGDLibrary
MATLAB/Octave library for stochastic optimization algorithms: Version 1.0.20
Stars: ✭ 165 (+432.26%)
Mutual labels:  sgd
a3c-super-mario-pytorch
Reinforcement Learning for Super Mario Bros using A3C on GPU
Stars: ✭ 35 (+12.9%)
Mutual labels:  multiprocessing
funboost
pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和全球一切知名消息队列中间件,python函数加速器,框架包罗万象,一统编程思维,兼容50% python编程业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数。旧名字是function_scheduling_distributed_framework
Stars: ✭ 351 (+1032.26%)
Mutual labels:  multiprocessing
FactorizationMachine
implementation of factorization machine, support classification.
Stars: ✭ 19 (-38.71%)
Mutual labels:  sgd
alphafold2-multiprocessing
Use AlphaFold by Deep Mind in Batch Mode + Multiprocessing
Stars: ✭ 22 (-29.03%)
Mutual labels:  multiprocessing
batchnorm-pruning
Rethinking the Smaller-Norm-Less-Informative Assumption in Channel Pruning of Convolution Layers https://arxiv.org/abs/1802.00124
Stars: ✭ 66 (+112.9%)
Mutual labels:  sgd
Ultra
An operating system that doesn't try to be UNIX. Made completely from scratch with its own bootloader. 😊
Stars: ✭ 48 (+54.84%)
Mutual labels:  multiprocessing
numpy-neuralnet-exercise
Implementation of key concepts of neuralnetwork via numpy
Stars: ✭ 49 (+58.06%)
Mutual labels:  sgd
atpbar
Progress bars for threading and multiprocessing tasks on terminal and Jupyter Notebook
Stars: ✭ 74 (+138.71%)
Mutual labels:  multiprocessing
Parallel-NDJSON-Reader
Parallel NDJSON Reader for Python
Stars: ✭ 13 (-58.06%)
Mutual labels:  multiprocessing
mantichora
A simple interface to Python multiprocessing and threading
Stars: ✭ 13 (-58.06%)
Mutual labels:  multiprocessing
LinkOS-Android-Samples
Java based sample code for developing on Android. The demos in this repository are stored on separate branches. To navigate to a demo, please click branches.
Stars: ✭ 52 (+67.74%)
Mutual labels:  sgd
neomake-multiprocess
A vim plugin for running multiple process asynchronously base on neomake.
Stars: ✭ 36 (+16.13%)
Mutual labels:  multiprocessing
ruck
🧬 Modularised Evolutionary Algorithms For Python with Optional JIT and Multiprocessing (Ray) support. Inspired by PyTorch Lightning
Stars: ✭ 50 (+61.29%)
Mutual labels:  multiprocessing
bsuir-csn-cmsn-helper
Repository containing ready-made laboratory works in the specialty of computing machines, systems and networks
Stars: ✭ 43 (+38.71%)
Mutual labels:  multiprocessing
think-async
🌿 Exploring cooperative concurrency primitives in Python
Stars: ✭ 178 (+474.19%)
Mutual labels:  multiprocessing
RTGraph
A simple Python application for plotting and storing data in real time
Stars: ✭ 45 (+45.16%)
Mutual labels:  multiprocessing
STransE
STransE: a novel embedding model of entities and relationships in knowledge bases (NAACL 2016)
Stars: ✭ 50 (+61.29%)
Mutual labels:  transe

该工程代码主要是实现自己阅读过的和知识图谱相关的经典算法的代码:
1.TransE是知识图谱中知识表示的经典算法,工程实现了训练代码(多进程通信版)和测试代码
后续如继续进行论文阅读会补充相应的代码
2.TransE论文地址: https://www.utc.fr/~bordesan/dokuwiki/_media/en/transe_nips13.pdf
3.TransE SGD解释与代码简单解释: https://blog.csdn.net/weixin_42348333/article/details/89598144

环境配置与前置技术要求:

环境配置

CPU 24 Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
内存 128G
系统 CentOS Linux release 7.5.1804 (Core)

涉及到的技术点

Linux基本操作与shell脚本简单语法 利用shell脚本去进行训练,避免使用Python文件中的main函数去训练
git基本操作
Python的多进程 可以参考https://blog.csdn.net/weixin_42348333/article/details/105126470
TensorFlow 常用API
Pycharm debug与pdb debug
对论文的训练和评估细节的深刻理解

训练部分

Simple版本

./train_fb15k.sh 0 仅仅使用Python完成对应的训练代码

Manager版本

./train_fb15k.sh 1 将TransE类的实例在多进程之间传递

Queue版本

./train_fb15k.sh 2 将TransE类的训练数据传入队列,减小进程开销,加快训练速度

注意事项

  1. 当训练完成之后,再进行测试。
  2. 测试代码需要在Linux环境执行,Windows环境多进程速度慢,且多进程有bug!!!

测试部分

TestMainTF

python TestMainTF.py tf与多进程测试加速,效果显著,Linux环境128G服务器,测试结束仅需要8min左右。

最终测试结果

image

THANKS

感谢两位前辈的代码,基本是在他们的基础上学习整理
https://github.com/wuxiyu/transE
https://github.com/ZichaoHuang/TransE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].