Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursorrrules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Launch all commands in the conda environement "bgbench"
Launch all commands in the conda environement "ogbench"

It should be done via the conda shell activate.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Code Quality](https://github.com/geometric-intelligence/bgbench/actions/workflows/code-quality-main.yaml/badge.svg)](https://github.com/geometric-intelligence/bgbench/actions/workflows/code-quality-main.yaml)
[![Dependencies](https://github.com/geometric-intelligence/bgbench/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/geometric-intelligence/bgbench/actions/workflows/dependabot/dependabot-updates)
[![Tests](https://github.com/geometric-intelligence/bgbench/actions/workflows/test.yml/badge.svg)](https://github.com/geometric-intelligence/bgbench/actions/workflows/test.yml)
[![Code Quality](https://github.com/geometric-intelligence/ogbench/actions/workflows/code-quality-main.yaml/badge.svg)](https://github.com/geometric-intelligence/ogbench/actions/workflows/code-quality-main.yaml)
[![Dependencies](https://github.com/geometric-intelligence/ogbench/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/geometric-intelligence/ogbench/actions/workflows/dependabot/dependabot-updates)
[![Tests](https://github.com/geometric-intelligence/ogbench/actions/workflows/test.yml/badge.svg)](https://github.com/geometric-intelligence/ogbench/actions/workflows/test.yml)

# OGBench — Omics Graph Benchmarking

Expand All @@ -19,12 +19,12 @@ A benchmarking framework for Graph Neural Networks on omics datasets. OGBench pr
## Installation

```bash
git clone git@github.com:geometric-intelligence/bgbench.git
cd bgbench
git clone git@github.com:geometric-intelligence/ogbench.git
cd ogbench

conda create -n bgbench python=3.12
conda create -n ogbench python=3.12
curl -LsSf https://astral.sh/uv/install.sh | sh
conda activate bgbench
conda activate ogbench

uv venv
uv pip install -e '.[all]'
Expand Down Expand Up @@ -175,7 +175,7 @@ pytest tests/nn/ -v # specific module
### Project Structure

```
bgbench/
ogbench/
├── ogbench/ # Main Python package
│ ├── run.py # Training entry point
│ ├── baseline.py # Sklearn baseline experiments
Expand Down
4 changes: 2 additions & 2 deletions configs/hparams_search/multi_dataset_grid_search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ seeds: [42, 123, 456]

# Fixed parameters (not searched)
fixed:
logger.wandb.project: bgbench_dataset_grid_search_final
logger.wandb.project: ogbench_dataset_grid_search_final
logger.wandb.entity: bioshape-lab
paths.root_dir: /scratch/lcornelis/bgbench
paths.root_dir: /scratch/lcornelis/ogbench

# Shared hyperparameter grid (applied to all models)
shared_grid:
Expand Down
2 changes: 1 addition & 1 deletion configs/hparams_search/smoke_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ models:
seeds: [42]

fixed:
logger.wandb.project: bgbench_smoke_test
logger.wandb.project: ogbench_smoke_test

shared_grid:
dataset.loader.parameters.node_sample_ratio:
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ if ! command -v conda &> /dev/null; then
echo "Conda installation complete"
fi

if ! conda env list | grep -q "bgbench"; then
conda create -n bgbench python=3.12 -y
if ! conda env list | grep -q "ogbench"; then
conda create -n ogbench python=3.12 -y
fi

conda activate bgbench
conda activate ogbench

pip install --upgrade pip
pip install -e '.[all]'
Expand Down
4 changes: 2 additions & 2 deletions notebooks/datasets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"import pandas as pd\n",
"import seaborn as sns\n",
"\n",
"sys.path.append(\"/home/johmathe/bgbench\")\n",
"sys.path.append(\"/home/johmathe/ogbench\")\n",
"os.environ[\"PYTHONPATH\"] = os.pathsep.join(sys.path)\n",
"from src.data import hf_datamodule\n"
]
Expand Down Expand Up @@ -115,7 +115,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "bgbench",
"display_name": "ogbench",
"language": "python",
"name": "python3"
},
Expand Down
8 changes: 8 additions & 0 deletions ogbench/transforms/liftings/graph2hypergraph/knn_lifting.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ def lift_topology(self, data: torch_geometric.data.Data) -> dict:
The lifted topology.
"""
num_nodes = data.x.shape[0]
# pyg-lib's knn_graph segfaults on empty inputs, so short-circuit.
if num_nodes == 0:
empty_incidence = torch.zeros(0, 0).to_sparse_coo()
return {
'incidence_hyperedges': empty_incidence,
'num_hyperedges': 0,
'x_0': data.x,
}
data.pos = data.x
num_hyperedges = num_nodes
incidence_1 = torch.zeros(num_nodes, num_nodes)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ dependencies=[
"torch-scatter",
"torch==2.8.0",
"torch-cluster",
"pyg-lib>=0.6.0",
"combat>=0.3.3",
"topomodelx @ git+https://github.com/pyt-team/TopoModelX.git",
"toponetx @ git+https://github.com/pyt-team/TopoNetX.git",
Expand Down Expand Up @@ -96,8 +97,8 @@ all = ["ogbench[dev, doc]"]
ogbench-train = "ogbench.run:main"

[project.urls]
homepage="https://geometric-intelligence.github.io/bgbench/index.html"
repository="https://github.com/geometric-intelligence/bgbench"
homepage="https://geometric-intelligence.github.io/ogbench/index.html"
repository="https://github.com/geometric-intelligence/ogbench"

[tool.ruff]
line-length = 99
Expand Down
2 changes: 1 addition & 1 deletion tutorials/benchmarking_stats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "bgbench",
"display_name": "ogbench",
"language": "python",
"name": "python3"
},
Expand Down
4 changes: 2 additions & 2 deletions tutorials/dataset_stats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"metadata": {},
"outputs": [],
"source": [
"root = \"/home/lcornelis/code/bgbench/run_data/omics/\"\n",
"root = \"/home/lcornelis/code/ogbench/run_data/omics/\"\n",
"name = osp.join(\n",
" root,\n",
" f\"{dataset.data_name}\",\n",
Expand Down Expand Up @@ -119,7 +119,7 @@
" Get statistics of the graph.\n",
" \"\"\"\n",
" # Load the adjacency matrix\n",
" root = \"/home/lcornelis/code/bgbench/run_data/omics/\"\n",
" root = \"/home/lcornelis/code/ogbench/run_data/omics/\"\n",
" name = osp.join(\n",
" root,\n",
" f\"{dataset.data_name}\",\n",
Expand Down
6 changes: 3 additions & 3 deletions tutorials/dataset_stats_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def load_dataset(
# Pass 'full' as string, not None, because HFOmicsDataset checks for 'full' string
ratio_value = 'full' if node_sample_ratio == 'full' else float(node_sample_ratio)
dataset = HFOmicsDataset(
root='/scratch/lcornelis/bgbench-1/run_data/omics',
root='/scratch/lcornelis/ogbench-1/run_data/omics',
data_name=dataset_name,
method=method,
adjacency_threshold=adj_thresh,
Expand Down Expand Up @@ -79,7 +79,7 @@ def get_graph_stats(dataset: Any) -> dict[str, float]:
graph.add_nodes_from(range(num_nodes))
graph.add_edges_from(edge_list)
else:
root = '/home/lcornelis/code/bgbench-1/run_data/omics/'
root = '/home/lcornelis/code/ogbench-1/run_data/omics/'
name = osp.join(
root,
f'{dataset.data_name}',
Expand Down Expand Up @@ -460,7 +460,7 @@ def main():
if __name__ == '__main__':
try:
print('Testing dataset loading...')
dataset = load_dataset('addneuromed', 0.5, '0.3', 'variance', adjacency_method='string', string_data_dir='/home/johmathe/bgbench/data')
dataset = load_dataset('addneuromed', 0.5, '0.3', 'variance', adjacency_method='string', string_data_dir='/home/johmathe/ogbench/data')
print(f'Dataset loaded successfully: {dataset}')
print(f'Dataset length: {len(dataset)}')
if len(dataset) > 0:
Expand Down
2 changes: 1 addition & 1 deletion webapp/public/data/stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -12479,4 +12479,4 @@
"dataset": "brca",
"adjacency_method": "string"
}
}
}
Loading