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
from distutils.core import setup | |
from Cython.Build import cythonize | |
setup( | |
#ext_modules=cythonize(['*.pyx']) | |
ext_modules=cythonize("*.pyx", compiler_directives={'profile': True}) | |
) |
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 os | |
import time | |
from pracmln import query | |
from pracmln import MLN, Database, query | |
def main(arg='.'): | |
pth = os.path.join(arg, 'wts.pybpll.smoking-train-smoking.mln') | |
mln = MLN(mlnfile=pth, grammar='StandardGrammar') | |
pth = os.path.join(arg, 'smoking-test.db') | |
db = Database(mln, dbfile=pth) |
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/ ... /PracMLN/python3/" | |
source ~/.prac3/bin/activate | |
python3 test.py | |
deactivate | |
PYTHONPATH="" | |
source ~/p3/bin/activate | |
python3 test.py |
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 | |
echo "Python, followed by Cython: " | |
bash testpc.sh | |
bash testpc.sh | |
bash testpc.sh | |
bash testpc.sh | |
bash testpc.sh | |
bash testpc.sh | |
bash testpc.sh |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 4 columns, instead of 1. in line 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
Inference, EnumerationAsk, 0.1270275115966797, 0.033542633056640625 | |
() | |
() | |
Inference, MC-SAT, 0.4272785186767578, 0.4875507354736328 | |
Inference, GibbsSampler, 0.12882208824157715, 0.12560558319091797 | |
Inference, WCSPInference, 0.14586448669433594, 0.03891730308532715 | |
Inference, EnumerationAsk, 0.12506461143493652, 0.03306984901428223 | |
() | |
() | |
Inference, MC-SAT, 0.3744349479675293, 0.4124472141265869 |
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 |
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='.'): | |
#if (len(sys)) | |
pth = os.path.join(arg, 'wts.pybpll.smoking-train-smoking.mln') |
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='.'): | |
#if (len(sys)) | |
pth = os.path.join(arg, 'wts.pybpll.smoking-train-smoking.mln') |
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='.'): | |
#if (len(sys)) | |
pth = os.path.join(arg, 'wts.pybpll.smoking-train-smoking.mln') |
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
mln = None | |
db = None | |
def set(): | |
from pracmln import MLN, Database, query | |
import sys | |
import os | |
global mln | |
global db | |
pth = os.path.join(sys.argv[1], 'wts.pybpll.smoking-train-smoking.mln') |
NewerOlder