Created
June 6, 2018 02:49
-
-
Save kaivalyar/63326e6545b0a217e88afb1edcbe70bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kaivalya@kaivalyarawal ~/Documents/WORK/GSoC/Gists/TaxonomiesInfer/MC-SAT $ bash test.sh | |
Traceback (most recent call last): | |
File "test.py", line 27, in <module> | |
main(sys.argv[1]) | |
File "test.py", line 15, in main | |
query(queries='has_sense, action_role', method='MC-SAT', mln=mln, db=db, verbose=False, multicore=True).run() | |
File "/home/kaivalya/Documents/WORK/GSoC/kPracMLN/python3/pracmln/mlnquery.py", line 249, in run | |
result = inference.run() | |
File "infer.pyx", line 189, in pracmln.mln.inference.infer.Inference.run | |
File "mcsat.pyx", line 240, in pracmln.mln.inference.mcsat.MCSAT._run | |
File "mcsat.pyx", line 267, in pracmln.mln.inference.mcsat.MCSAT._satisfy_subset | |
KeyError: 0 | |
Traceback (most recent call last): | |
File "test.py", line 27, in <module> | |
main(sys.argv[1]) | |
File "test.py", line 15, in main | |
query(queries='has_sense, action_role', method='MC-SAT', mln=mln, db=db, verbose=False, multicore=True).run() | |
File "/home/kaivalya/p3/lib/python3.5/site-packages/pracmln/mlnquery.py", line 249, in run | |
result = inference.run() | |
File "/home/kaivalya/p3/lib/python3.5/site-packages/pracmln/mln/inference/infer.py", line 189, in run | |
self._results = self._run() | |
File "/home/kaivalya/p3/lib/python3.5/site-packages/pracmln/mln/inference/mcsat.py", line 235, in _run | |
state = self._satisfy_subset(chain) | |
File "/home/kaivalya/p3/lib/python3.5/site-packages/pracmln/mln/inference/mcsat.py", line 262, in _satisfy_subset | |
clause_range = self.gf2clauseidx[gfidx] | |
KeyError: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import sys | |
import os | |
import time | |
from pracmln import query | |
from pracmln import MLN, Database, query | |
def main(arg='.'): | |
pth = os.path.join(arg, 'wts.learned.taxonomy.mln') | |
mln = MLN(mlnfile=pth, grammar='PRACGrammar', logic='FuzzyLogic') | |
pth = os.path.join(arg, 'evidence.db') | |
db = Database(mln, dbfile=pth) | |
start = time.time() | |
query(queries='has_sense, action_role', method='MC-SAT', mln=mln, db=db, verbose=False, multicore=True).run() | |
t1 = time.time()-start | |
start = time.time() | |
query(queries='has_sense, action_role', method='MC-SAT', mln=mln, db=db, verbose=False, multicore=False).run() | |
t2 = time.time()-start | |
print('Inference, EnumerationAsk, {}, {}'.format(t1, t2)) | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
main() | |
else: | |
main(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PYTHONPATH="${PYTHONPATH}:/home/kaivalya/Documents/WORK/GSoC/kPracMLN/python3/" | |
source ~/.prac3/bin/activate | |
python3 test.py .. >> ../cython_summary.csv | |
deactivate | |
PYTHONPATH="" | |
source ~/p3/bin/activate | |
python3 test.py .. >> ../python_summary.csv | |
deactivate | |
PYTHONPATH="${PYTHONPATH}:/home/kaivalya/Documents/WORK/GSoC/kPracMLN/python3/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment