Browse Source

[FIX] fix a few bugs

ab_data
Gao Enhao 2 years ago
parent
commit
b043bf6aee
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      abl/learning/abl_model.py
  2. +1
    -1
      abl/reasoning/kb.py
  3. +2
    -2
      examples/hed/hed_example.ipynb

+ 1
- 1
abl/learning/abl_model.py View File

@@ -10,7 +10,7 @@
#
# ================================================================#
import pickle
from utils import flatten, reform_idx
from ..utils import flatten, reform_idx
from typing import List, Any, Optional




+ 1
- 1
abl/reasoning/kb.py View File

@@ -142,7 +142,7 @@ class ground_KB(KBBase):
key_idx = bisect.bisect_left(key_list, y)
all_candidates = []
for idx in range(key_idx - 1, 0, -1):
for idx in range(key_idx - 1, -1, -1):
k = key_list[idx]
if abs(k - y) <= self.max_err:
all_candidates.extend(potential_candidates[k])


+ 2
- 2
examples/hed/hed_example.ipynb View File

@@ -12,7 +12,7 @@
"\n",
"from abl.reasoning import ReasonerBase, prolog_KB\n",
"from abl.learning import BasicNN, ABLModel\n",
"from abl.evaluation import SymbolMetric, ABLMetric\n",
"from abl.evaluation import SymbolMetric, SemanticsMetric\n",
"from abl.utils import ABLLogger, reform_idx\n",
"\n",
"from examples.hed.hed_bridge import HEDBridge\n",
@@ -206,7 +206,7 @@
"outputs": [],
"source": [
"# Add metric\n",
"metric = [SymbolMetric(prefix=\"hed\"), ABLMetric(prefix=\"hed\")]"
"metric = [SymbolMetric(prefix=\"hed\"), SemanticsMetric(prefix=\"hed\")]"
]
},
{


Loading…
Cancel
Save