Skip to content
Open
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 hyperbench/hlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .hgnn_hlp import HGNNHlpModule, HGNNEncoderConfig
from .hnhn_hlp import HNHNEncoderConfig, HNHNHlpModule
from .hgnnp_hlp import HGNNPEncoderConfig, HGNNPHlpModule
from .hlp import HlpModule
from .common import HlpModule
from .hypergcn_hlp import HyperGCNHlpModule, HyperGCNEncoderConfig
from .mlp_hlp import MLPHlpModule, MlpEncoderConfig
from .node2vec_common import (
Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions hyperbench/hlp/common_neighbors_hlp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
import logging as log
import warnings

from torch import Tensor, nn
from typing import Literal, Optional
Expand All @@ -8,7 +8,7 @@
from hyperbench.types import HData, Hypergraph
from hyperbench.utils import Aggregation, Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule


class CommonNeighborsHlpModule(HlpModule):
Expand Down Expand Up @@ -57,9 +57,11 @@ def forward(self, hyperedge_index: Tensor) -> Tensor:
def on_fit_start(self) -> None:
"""Warn users if they are running unnecessary training epochs."""
if self.trainer.max_epochs is None or self.trainer.max_epochs > 0:
log.warning(
warnings.warn(
f"{self.__class__.__name__} is a non-trainable heuristic model. "
"No optimization occurs. Set max_epochs=0 in your trainer for instant evaluation."
"No optimization occurs. Set max_epochs=0 in your trainer for instant evaluation.",
UserWarning,
stacklevel=2,
)

def training_step(self, batch: HData, batch_idx: int) -> Tensor:
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/gcn_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from hyperbench.types import EdgeIndex, HData, HyperedgeIndex
from hyperbench.utils import ActivationFn, Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule


class GCNEncoderConfig(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/hgnn_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from torchmetrics import MetricCollection
from hyperbench.utils import Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule


class HGNNEncoderConfig(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/hgnnp_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from hyperbench.types import HData
from hyperbench.utils import Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule


class HGNNPEncoderConfig(TypedDict):
Expand Down
5 changes: 2 additions & 3 deletions hyperbench/hlp/hnhn_hlp.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from typing import Literal, Optional, TypedDict

from torch import Tensor, nn, optim
from torchmetrics import MetricCollection
from typing_extensions import NotRequired

from hyperbench.hlp.hlp import HlpModule
from hyperbench.models import HNHN, SLP
from hyperbench.nn import HyperedgeAggregator
from hyperbench.types import HData
from hyperbench.utils import Stage

from hyperbench.hlp.common import HlpModule


class HNHNEncoderConfig(TypedDict):
"""
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/hypergcn_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from torchmetrics import MetricCollection
from hyperbench.utils import Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule


class HyperGCNEncoderConfig(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/mlp_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from torchmetrics import MetricCollection
from hyperbench.utils import ActivationFn, NormalizationFn, Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule


class MlpEncoderConfig(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/node2vecgcn_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from hyperbench.nn import HyperedgeAggregator
from hyperbench.utils import Stage

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule
from hyperbench.hlp.node2vec_common import (
NODE2VEC_JOINT_MODE,
NODE2VEC_PRECOMPUTED_MODE,
Expand Down
2 changes: 1 addition & 1 deletion hyperbench/hlp/node2vecslp_hlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from hyperbench.utils import Stage
from hyperbench.nn import HyperedgeAggregator

from hyperbench.hlp.hlp import HlpModule
from hyperbench.hlp.common import HlpModule
from hyperbench.hlp.node2vec_common import (
NODE2VEC_JOINT_MODE,
Node2VecHlpConfig,
Expand Down
Loading