-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ce Zhang
committed
Sep 7, 2013
1 parent
c96ba2a
commit 280d406
Showing
300 changed files
with
8,350 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Provides interfaces to the RDBMS. Currently only supports PostgreSQL. | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Provides facilities for grounding MLNs, including KBMC, SQL-based grounding, and MRF partitioning. | ||
|
||
<p> | ||
Grounding will be conducted in three phases: | ||
<ul> | ||
<li> Ground relevant atoms: This phase is done by class KBMC. In this phase, a rough sift | ||
of atoms results from a partially grounded predicate tables. In these tables (one | ||
for each predicate), those definitely not useful atoms are not grounded. | ||
<li> Pick active atoms: This phase is done by class Grounding. In this phase, all | ||
atoms that will not violate any clauses by default are further eliminated | ||
on the basis of the first phase. These eliminated atoms will not play any role | ||
in following inference or learning, therefore grounding them out will make no sense. | ||
<li> Ground active clauses: This phase is done by class Grounding. In this phase, clauses | ||
are grounded according to picked active atoms in the second phase. Clauses relying on | ||
exactly the same atoms will be merged together to form GClause for efficiency | ||
consideration. | ||
</ul> | ||
</p> | ||
|
||
|
||
|
||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Data structures and algorithms for MRF partitioning. | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Misc functionalities to help develop MLN programs. | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Data structures used to represent MRFs. | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Provides MLN inference algorithms. Currently supports MAP inference and | ||
Marginal inference. | ||
|
||
<p> | ||
By default this package deals with inference in memory. It first loads from | ||
database about information of MLN groundings. Then, it forms a MRF by taking | ||
GAtom and GClause as elements. Once this MRF is formed, this package will not | ||
interact with DBMS. | ||
</p> | ||
|
||
<p> | ||
Marginal and MAP inference on this in-memory structure follow classic scheme. | ||
There are indices from GClause to GAtom, vice versa. Therefore, the change | ||
of GAtom's truth assignment will influence GClause's truth value. Together with the | ||
sign of GClause's weight, whether a GClause is violated in current truth assignment | ||
setting can be tracked. The WalkSAT or MCSAT subroutines are then invoked. | ||
</p> | ||
|
||
|
||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Provides weight learning in Tuffy. | ||
|
||
<p> | ||
This package provide frameworks for weight learning. You can write | ||
your own learner by materializing several functions of the abstract class | ||
Learner. An example in this package is DNLearner, which implements | ||
a Diagonal Newton optimizer. This materialized class only need to tell | ||
the learner how to update the weight according to the gradient and Hessian. | ||
</p> | ||
|
||
<p> | ||
This package deals with in memory MRF directly, and has nothing | ||
to do with DBMS. The flow of learning involves repetitive invocations of MCSAT (see | ||
package infer), which will update the expectation of clause violation/satisfaction | ||
under current weight settings. | ||
</p> | ||
|
||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
Entrances to Tuffy. | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<html> | ||
<head> | ||
<title>package</title> | ||
</head> | ||
<body> | ||
|
||
This package builds the data structure of MLN. | ||
|
||
<p> | ||
This package defines the data structure representing logics, e.g., | ||
Atom, Predicate, Term, etc. Also, it bridges these objects to | ||
relational tables in DBMS. | ||
</p> | ||
|
||
<p> | ||
Following figure illustrates the relationship between classes in this | ||
package, and the relationship between class and database table. For example, | ||
from this figure, we can see that, an Atom object is formed by a Tuple object | ||
and a Predicate object. And a Predicate object is associated with two | ||
database tables. | ||
</p> | ||
|
||
<p> | ||
There are four kinds of database tables. type_TypeName table saves the constant | ||
ID of type TypeName. pred_PredicateName table saves grounded instances of predicate | ||
PredicateName. | ||
act_pred_PredicateName table saves the active atoms of predicate PredicateName. | ||
ClauseName_instances table saves instances of clause ClauseName. Here by instance, | ||
it means the possible binding from meta-variable to constant. By such bindings, you | ||
can get clauses as the same as your input program. | ||
</p> | ||
|
||
|
||
|
||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
grammar Config; | ||
options {language=Java; output=AST; backtrack=false; memoize=false;} | ||
|
||
@lexer::header { | ||
package tuffy.parse; | ||
} | ||
|
||
@parser::header{ | ||
package tuffy.parse; | ||
import java.util.Hashtable; | ||
import tuffy.mln.*; | ||
import tuffy.util.*; | ||
} | ||
|
||
@parser::members { | ||
public Hashtable<String, String> map = new Hashtable<String, String>(); | ||
} | ||
|
||
WS : (' ' | ||
| '\r' | ||
| '\n' | ||
| '\t' | ||
) {$channel=HIDDEN;} | ||
; | ||
|
||
COMMENT | ||
: (('#' ~('\n'|'\r')* '\r'? '\n')) {$channel=HIDDEN;} | ||
; | ||
|
||
SPAN: ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'-'|':'|'/'|'\\'|'\.')+; | ||
|
||
config : (state)+ EOF; | ||
|
||
state : id=SPAN '=' value=SPAN | ||
{ | ||
map.put($id.text, $value.text); | ||
} | ||
; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
WS=4 | ||
SPAN=6 | ||
COMMENT=5 | ||
T__7=7 | ||
'='=7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.