Skip to content

Commit

Permalink
Merge pull request #28 from aimclub/append-docs
Browse files Browse the repository at this point in the history
append docs
  • Loading branch information
bda82 authored Dec 11, 2023
2 parents 64ae9fd + 3f19c91 commit 91b9d55
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ venv.bak/
.mypy_cache/
.dmypy.json
dmypy.json

# MacOS
.DS_Store
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,47 @@ train(Config(), item_vocab, model, optimizer)
```

### Визуализация графов и гиперграфов
Для визуализации графов и гиперграфов используется система [`справочников`](./redkg/visualization/config/parameters/) для установки параметров визуализации, а также система [`контрактов`](./redkg/visualization/contracts/) для установки графических элементов.

Пример визуализации графа:
```python
graph_contract: GraphContract = GraphContract(
vertex_num=10,
edge_list=(
[(0, 7), (2, 7), (4, 9), (3, 7), (1, 8), (5, 7), (2, 3), (4, 5), (5, 6), (4, 8), (6, 9), (4, 7)],
[1.0] * 12,
),
edge_num=12,
edge_weights=list(tensor([1.0] * 24)),
)

vis_contract: GraphVisualizationContract = GraphVisualizationContract(graph=graph_contract)

vis: GraphVisualizer = GraphVisualizer(vis_contract)
fig = vis.draw()
fig.show()
```

Пример визуализации гиперграфа:
```python
graph_contract: HypergraphContract = HypergraphContract(
vertex_num=10,
edge_list=(
[(3, 4, 5, 9), (0, 4, 7), (4, 6), (0, 1, 2, 4), (3, 6), (0, 3, 9), (2, 5), (4, 7)],
[1.0] * 8,
),
edge_num=8,
edge_weights=list(tensor([1.0] * 10)),
)

vis_contract: HypergraphVisualizationContract = HypergraphVisualizationContract(graph=graph_contract)

vis: HypergraphVisualizer = HypergraphVisualizer(vis_contract)
fig = vis.draw()
fig.show()
```

Документация
=============
Подробная информация и описание библиотеки ReDKG доступны по [`ссылке`](https://aimclub.github.io/ReDKG/)
Expand Down
41 changes: 41 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,47 @@ train(Config(), item_vocab, model, optimizer)
```

### Visualization of graphs and hypergraphs
The [`reference books`](./redkg/visualization/config/parameters/) system is used to visualize graphs and hypergraphs to set visualization parameters, as well as the [`contracts`](./redkg/visualization/contracts/) system to install graphic elements.

Graph visualization example:
```python
graph_contract: GraphContract = GraphContract(
vertex_num=10,
edge_list=(
[(0, 7), (2, 7), (4, 9), (3, 7), (1, 8), (5, 7), (2, 3), (4, 5), (5, 6), (4, 8), (6, 9), (4, 7)],
[1.0] * 12,
),
edge_num=12,
edge_weights=list(tensor([1.0] * 24)),
)

vis_contract: GraphVisualizationContract = GraphVisualizationContract(graph=graph_contract)

vis: GraphVisualizer = GraphVisualizer(vis_contract)
fig = vis.draw()
fig.show()
```

Hypergraph visualization example:
```python
graph_contract: HypergraphContract = HypergraphContract(
vertex_num=10,
edge_list=(
[(3, 4, 5, 9), (0, 4, 7), (4, 6), (0, 1, 2, 4), (3, 6), (0, 3, 9), (2, 5), (4, 7)],
[1.0] * 8,
),
edge_num=8,
edge_weights=list(tensor([1.0] * 10)),
)

vis_contract: HypergraphVisualizationContract = HypergraphVisualizationContract(graph=graph_contract)

vis: HypergraphVisualizer = HypergraphVisualizer(vis_contract)
fig = vis.draw()
fig.show()
```

Documentation
=============
Detailed information and description of ReDKG framework is available in the [`Documentation`](https://aimclub.github.io/ReDKG/)
Expand Down

0 comments on commit 91b9d55

Please sign in to comment.