文件历史

15 次代码提交

作者 SHA1 备注 提交日期
Muhammed Fatih BALIN b1e2695f3e [Feature] replace dgl PRNG with pcg32 (#4807)
* replace dgl PRNG with pcg32

* remove pcg submodule, add a simple implementation

* replace pcg32 with std::mt19937_64

* fix include order

* change RandomEngine to pcg32

* Remove custom pcg32 implementation, use the submodule provided by the original author.

* minor bug

* move include for linting

* include pcg for tests too

Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2022-12-01 09:19:28 +08:00
Hongzhi (Steve), Chen cb5e3489c0 [Misc] Minor code style fix. (#4843)
* [Misc] Change the max line length for cpp to 80 in lint.

* blabla

* blabla

* blabla

* ablabla

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2022-11-08 16:39:45 +08:00
Muhammed Fatih BALIN 2db4928ea4 a better way to init threadlocal prng (#4808)
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2022-11-08 12:28:19 +08:00
Hongzhi (Steve), Chen bcd3768426 [Misc] Replace /*! with /**. (#4823)
* replace

* blabla

* balbla

* blabla

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2022-11-07 08:16:41 +08:00
Hongzhi (Steve), Chen 6c53f351c6 Replace \xxx with @xxx in structured comment. (#4815)
* replace

* more

* file

* change

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2022-11-04 22:59:13 +08:00
Hongzhi (Steve), Chen 07dc8fb666 [Misc] clang-format auto fix. (#4800)
* clang-format

* manul

* manul

* manual

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2022-11-02 16:53:19 +08:00
Xin Yao cded5b80fe [Feature] Bump DLPack to v0.7 and decouple DLPack from the core library (#4454)
* rename `DLContext` to `DGLContext`

* rename `kDLGPU` to `kDLCUDA`

* replace DLTensor with DGLArray

* fix linting

* Unify DGLType and DLDataType to DGLDataType

* Fix FFI

* rename DLDeviceType to DGLDeviceType

* decouple dlpack from the core library

* fix bug

* fix lint

* fix merge

* fix build

* address comments

* rename dl_converter to dlpack_convert

* remove redundant comments
2022-09-19 16:02:43 +08:00
Quan (Andy) Gan 90f10b31cb [Feature] Negative sampling (#3599)
* first commit

* a bunch of fixes

* add unique

* lint

* lint

* lint

* address comments

* Update negative_sampler.py

* fix

* description

* address comments and fix

* fix

* replace unique with replace

* test pylint

* Update negative_sampler.py
2022-01-07 18:26:14 +08:00
Qidong Su 6b022d2fe2 [Sampler] BiasedChoice sampler (#1665)
* update

* update

* update

* update

* update

* update

* update

* fix

* fix

* update

* doc

* doc

* fix

* fix

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-04-22 15:12:52 +08:00
Minjie Wang 5dd35580f7 [Feature] Improve sampling speed; Better pickle/unpickle; other fixes (#1299)
* improve performance of sample_neighbors

* some more improve

* test script

* benchmarks

* multi process

* update more tests

* WIP

* adding two API for state saving

* add create from state

* upd test

* missing file

* wip: pickle/unpickle

* more c apis

* find the problem of empty data array

* add null array; pickling speed is bad

* still bad perf

* still bad perf

* wip

* fix the pickle speed test; now everything looks good

* minor fix

* bugfix

* some lint fix

* address comments

* more fix

* fix lint

* add utest for random.choice

* add utest for dgl.rand_graph

* fix cpp utests

* try fix ci

* fix bug in TF backend

* upd choice docstring

* address comments

* upd

* try fix compile

* add comment
2020-03-02 23:16:05 +08:00
Minjie Wang f8d4264e5b [Feature] Neighbor-hood based sampling APIs (#1251)
* WIP: working on random choices

* light slice

* basic CPU impl

* add python binding; fix CreateFromCOO and CreateFromCSR returning unitgraph

* simple test case works

* fix bug in slicing probability array

* fix bug in getting the correct relation graph

* fix bug in creating placeholder graph

* enable omp

* add cpp test

* sample topk

* add in|out_subgraph

* try fix lint; passed all unittests

* fix lint

* fix msvc compile; add sorted flag and constructors

* fix msvc

* coosort

* COOSort; CSRRowWiseSampling; CSRRowWiseTopk

* WIP: remove DType in CSR and COO; Restrict data array to be IdArray

* fix all CSR ops for missing data array

* compiled

* passed tests

* lint

* test sampling out edge

* test different per-relation fanout/k values

* fix bug in random choice

* finished cpptest

* fix compile

* Add induced edges

* add check

* fixed bug in sampling on hypersparse graph; add tests

* add ascending flag

* in|out_subgraph returns subgraph and induced eid

* address comments

* lint

* fix
2020-02-17 21:25:21 +08:00
Quan (Andy) Gan a9dabcc769 [Feature] Random Walk for 0.5 (#1209)
* trying to refactor IndexSelect

* partial implementation

* add index select and assign for floats as well

* move to random choice source

* more updates

* fixes

* fixes

* more fixes

* adding python impl

* fixes

* unit test

* lint

* lint x2

* lint x3

* update metapath2vec

* debugging performance

* still debugging for performance

* tuning

* switching to succvec

* redo

* revert non-uniform sampler to use vector

* still not fast

* why does this crash with OpenMP???

* because there was a data race!!!

* add documentations and remove assign op

* lint

* lint x2

* lol what have i done

* lint x3

* fix and disable gpu testing

* bugfix

* generic random walk

* reorg the random walk source code

* Update randomwalks.h

* Update randomwalks_cpu.cc

* rename file

* move internal function to anonymous ns

* reorg & docstrings

* constant restart probability

* docstring fix

* more commit

* random walk with restart, tested

* some fixes

* switch to using NDArray for choice

* massive fix & docstring

* lint x?

* lint x??

* fix

* export symbols

* skip gpu test

* addresses comments

* replaces another VecToIdArray

* add randomwalks.h to include

* replace void * with template
2020-01-31 19:52:08 +08:00
Quan (Andy) Gan 64f6f3c1a8 [Bug?] Fix non-determinism when setting the same seed across different runs with single thread (#1205)
* fix multithread random seed value

* more fix

* typo

* what did i wrote
2020-01-16 15:03:26 +08:00
Zihao Ye dfb10db86f [Feature] Bag of samplers for efficient categorical sampling w/ and w/o replacement (#1142)
* upd

* upd

* lint

* upd

* upd

* lint

* upd

* refactor

* lint

* upd

* upd

* upd

* lint

* fix

* fix

* upd

* upd

* upd

* upd

* upd

* upd

* upd

* complete test

* upd

* upd

* fix

* vir

* upd

* fix

* fuck

* fix numerical
2020-01-01 11:42:11 +08:00
Quan (Andy) Gan e9e587b6cb [Refactor] C random number generator (#729)
* rng refactor

* fix bugs

* unit test

* remove setsize

* lint

* fix test

* use explicit instantiation instead of inlining

* stricter test

* use tvm solution

* moved python interface to dgl.random

* lint

* address comments

* make getthreadid an inline function
2019-07-31 17:54:30 +08:00