项目文件夹

文件
Quan (Andy) Gan 6066fee935 [Model][Feature] PinSage & Random Walk with Restart (#453)
* random walk traces generation

* remove outdated comments

* oops put in the wrong place

* explicit inline

* moving rand_r to util

* pinsage-like model on movielens

* the code runs now

* support cuda

* using readonly graph

* moving random walk to public function

* per-thread seed and openmp support

* pinsage-like model on movielens

* the code runs now

* support cuda

* using readonly graph

* using C random walk

* removing profile decorators

* param initialization

* no grad

* leaky relu fixes everything

* train and save

* WIP

* WIP

* WIP

* seems to work

* evaluation output

* swapping order of val/test and train

* debug

* hyperparam tuning

* prior/training dataset split changes

* random walk reorg

* random walk with restart

* signed comparison fix

* migrating random walk to nodeflow

* Revert "migrating random walk to nodeflow"

This reverts commit f2565347cced7c912a58a529b257c033d9f375b7.

* add README and remove dataset

* new endpoint

* lint

* lint x2

* oops forgot test

* including bpr - better for baseline

* addressing fixes

* throwing random walks out from SamplerOp class

* forgot to move RandomWalk; why did this even work?

* removing legacy garbage

* add todo

* address comments

* stupid bug fix

* call ndarrayvector converter to handle traces
2019-03-29 13:01:18 +08:00

54 行
1.2 KiB
C++

/*!
* Copyright (c) 2017 by Contributors
* \file dgl/runtime/util.h
* \brief Useful runtime util.
*/
#ifndef DGL_RUNTIME_UTIL_H_
#define DGL_RUNTIME_UTIL_H_
#include "c_runtime_api.h"
namespace dgl {
namespace runtime {
/*!
* \brief Check whether type matches the given spec.
* \param t The type
* \param code The type code.
* \param bits The number of bits to be matched.
* \param lanes The number of lanes sin the type.
*/
inline bool TypeMatch(DGLType t, int code, int bits, int lanes = 1) {
return t.code == code && t.bits == bits && t.lanes == lanes;
}
} // namespace runtime
} // namespace dgl
// Forward declare the intrinsic id we need
// in structure fetch to enable stackvm in runtime
namespace dgl {
namespace ir {
namespace intrinsic {
/*! \brief The kind of structure field info used in intrinsic */
enum DGLStructFieldKind : int {
// array head address
kArrAddr,
kArrData,
kArrShape,
kArrStrides,
kArrNDim,
kArrTypeCode,
kArrTypeBits,
kArrTypeLanes,
kArrByteOffset,
kArrDeviceId,
kArrDeviceType,
kArrKindBound_,
// DGLValue field
kDGLValueContent,
kDGLValueKindBound_
};
} // namespace intrinsic
} // namespace ir
} // namespace dgl
#endif // DGL_RUNTIME_UTIL_H_