Skip to content

Commit

Permalink
index edge2vec converts names for agatha training
Browse files Browse the repository at this point in the history
  • Loading branch information
JSybrandt committed May 22, 2020
1 parent 82b8588 commit c1c7b1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions agatha/ml/hypothesis_predictor/hypothesis_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,11 @@ def add_argparse_args(parser:ArgumentParser)->ArgumentParser:
parser.add_argument("--warmup-steps", type=int)
parser.add_argument("--weight-decay", type=float)
parser.add_argument("--disable-cache", action="store_true")
parser.add_argument(
"--simple",
help="If set, ignore graph and use a simpler model architecture.",
action="store_true"
)
return parser

def init_ddp_connection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import pickle
from typing import Iterable, List, Tuple
from tqdm import tqdm
from agatha.ml.hypothesis_predictor.predicate_util import clean_coded_term


def iterate_vectors(vector_text_path:Path)->Iterable[Tuple[str, List[float]]]:
Expand Down Expand Up @@ -61,7 +62,7 @@ def main(
idx2node = {i: n for n, i in node2idx.items()}

node2vec = {
idx2node[idx]: vec
clean_coded_term(idx2node[idx]): vec
for idx, vec
in tqdm(iterate_vectors(input_vector_text_path))
}
Expand Down

0 comments on commit c1c7b1f

Please sign in to comment.