Skip to content

Commit b611dd6

Browse files
committed
update readme!
1 parent b4fe797 commit b611dd6

File tree

5 files changed

+43
-4
lines changed

5 files changed

+43
-4
lines changed

HyperG/utils/meter/transductive.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def trans_iou_socre(pred, target, mask):
1818
target_idx = target == _c
1919
intersection = (pred_idx & target_idx).sum().float().item()
2020
union = (pred_idx | target_idx).sum().float().item()
21-
ious.append((intersection + 1e-6)/(union + 1e-6))
21+
ious.append((intersection + 1e-6) / (union + 1e-6))
2222

2323
return ious
24-

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
11
#Hypergraph Toolbox: HyperG
2-
A toolbox for hypergraph including edge construction, graph construction and graph/hypergraph convolution.
2+
**HyperG** is a python toolbox for hypergraph-based deep learning, which is built upon [pytorch](https://pytorch.org/).
3+
Edge in hypergraph named hyperedge can link more than two nodes, which allows hyperedge to express more than pair-wise
4+
relation(like: entity-attribute relation, group relation, hierarchical relation and so on.). Thus, hypergraph owns more
5+
powerful model ability than common graph.
6+
7+
It consists of sparse hypergraph construction, fusion, convolution operations, convenient util functions for medical
8+
image(MRI, Pathology, etc.), 3D(point cloud, view-based graph, etc.) and other hypergraph applications(to be continue...).
9+
Hypergrpah inductive learning and hypergraph transductive learning examples is also included in this toolbox. What's more,
10+
we write several examples that deploy hypergraph in different tasks like: Classification, Segmentation and Regression.
11+
12+
The supported operations include:
13+
14+
* **Hyperedge base operations**: compute hyperedge/node degree, add/remove hypergraph self loop, count hyperedge/node number,
15+
16+
* **Hyperedge construction operations**: construct hyperedge group from grid-like structure (image) with spatial neighbors,
17+
construct hyperedge group from feature spatial neighbors. K Nearest Neighbors algorithm is supported here.
18+
19+
* **Hyperedge group/Hypergraph fusion operations**: fusion hypergraphs with concatenate constructed hypergraph incidence matrix.
20+
21+
* **Hypergraph Convolution**: the common hyconv(hypergrpah convolution) ([Feng et al. AAAI2019](https://github.com/iMoonLab/HGNN))
22+
is implemented here.
23+
24+
* **models**: HGNN([Feng et al. AAAI2019](https://github.com/iMoonLab/HGNN)) with two hyconv layers, ResNet(18, 34, 50, 101, 152)
25+
([He et al.](https://arxiv.org/abs/1512.03385)), and ResNet_HGNN a combination of ResNet and HGNN for image input and real-time
26+
construct hypergraph supported.
27+
28+
* **utils**: some convenient util functions(to be continue... ):
29+
* **data**: multiple modality data supported (to be continue...)
30+
* **mri**: mri series read and write functions.
31+
* **pathology**: sample patches from WSI slide return patch coordinates(left top point) and patch width and height.
32+
draw sampled patches on WSI slide function for overview or visualization.
33+
* **meter**: evaluate meters in hypergraph learning.
34+
* **inductive**: *C-Index Meter* for survival prediction.
35+
* **transductive**: compute class accuracy in classification task for transductive learning, compute IOU Score for
36+
segmentation task in transductive learning.
37+
* **visualization**: some visualization functions.
38+
* **transductive**: visualize segmentation result in transductive learning.
39+
40+
41+
42+
including edge construction, graph construction and graph/hypergraph convolution.

dist/HyperG-yifanfeng-0.0.1.tar.gz

-1.05 KB
Binary file not shown.
-2.26 KB
Binary file not shown.

examples/regression/survival_prediction/data_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from HyperG.utils.data.pathology import sample_patch_coors, draw_patches_on_slide
1414

1515

16-
def split_train_val(data_root, ratio=0.8, save_split_dir=None, resplit=False):
16+
def split_train_val(data_root, ratio=0.8, save_split_dir=None, resplit=True):
1717
if not resplit and save_split_dir is not None and osp.exists(save_split_dir):
1818
with open(save_split_dir, 'rb') as f:
1919
result = pickle.load(f)

0 commit comments

Comments
 (0)