Upload node2vec_model.py with huggingface_hub
Browse files- node2vec_model.py +3 -5
node2vec_model.py
CHANGED
|
@@ -13,11 +13,9 @@ from torch_geometric.data.data import DataEdgeAttr, DataTensorAttr
|
|
| 13 |
from torch_geometric.data.storage import BaseStorage, EdgeStorage, GlobalStorage
|
| 14 |
from torch_geometric.nn import Node2Vec
|
| 15 |
|
| 16 |
-
import
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
GRAPH = f"{DATA_DIR}/edge_ML_expected_ge5_pyg.pt"
|
| 21 |
|
| 22 |
|
| 23 |
def load_graph(path: str = GRAPH) -> Data:
|
|
@@ -56,7 +54,7 @@ def main() -> None:
|
|
| 56 |
ap.add_argument("--num-workers", type=int, default=4)
|
| 57 |
ap.add_argument("--epochs", type=int, default=0, help="0 = smoke check only")
|
| 58 |
ap.add_argument("--steps", type=int, default=5, help="steps for the smoke check")
|
| 59 |
-
ap.add_argument("--out", default=
|
| 60 |
args = ap.parse_args()
|
| 61 |
|
| 62 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 13 |
from torch_geometric.data.storage import BaseStorage, EdgeStorage, GlobalStorage
|
| 14 |
from torch_geometric.nn import Node2Vec
|
| 15 |
|
| 16 |
+
from paths import EMB_PATH, GRAPH_PATH
|
| 17 |
|
| 18 |
+
GRAPH = GRAPH_PATH
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
def load_graph(path: str = GRAPH) -> Data:
|
|
|
|
| 54 |
ap.add_argument("--num-workers", type=int, default=4)
|
| 55 |
ap.add_argument("--epochs", type=int, default=0, help="0 = smoke check only")
|
| 56 |
ap.add_argument("--steps", type=int, default=5, help="steps for the smoke check")
|
| 57 |
+
ap.add_argument("--out", default=EMB_PATH)
|
| 58 |
args = ap.parse_args()
|
| 59 |
|
| 60 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|