|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfer.Infer
tmpLearn.Learner
public abstract class Learner
The abstract class of learning a weight of MLN. A runnable learner should extend this abstract class by specifying some ad-hoc functions. This class extends Infer class, because it uses inference as subroutines. NOTE, THIS CLASS HAS A STATIC VARIABLE CURRENTWEIGHT. PARALLEL RUNNING OF MULTIPLE LEARNER INSTANCEs MAY CAUSE PROBLEMS... NOTE2, CURRENTLY ASSUME THE ACTIVE SET IS NOT CHANGED WHEN FLIPPING A POSITIVE CLAUSE TO NEGATIVE CLAUSE.
Field Summary | |
---|---|
int |
backtrackCount_
|
boolean |
backtracked
|
static java.util.HashMap<java.lang.String,java.lang.Double> |
currentD
|
static java.util.HashMap<java.lang.String,java.lang.Double> |
currentWeight
Map from clause name to current clause weight. |
static java.util.HashMap<java.lang.String,java.lang.Double> |
finalWeight
Map from clause name to final weight. |
boolean |
isFirstTime
|
static java.util.HashMap<java.lang.String,java.lang.Boolean> |
isHardMappings
Map from clause name to whether it is assigned to hard weight clause while learning. |
double |
odds
FOR JUNIT TEST ONLY. |
java.util.HashMap<java.lang.String,java.lang.Double> |
oldWeight
Map from clause name to clause weight learned in last iteration. |
java.util.HashMap<java.lang.String,java.lang.Integer> |
trainingSatisification
Map from clause name to current training data satisfication. |
java.util.HashMap<java.lang.String,java.lang.Integer> |
trainingViolation
Map from clause name to current training data violation. |
Fields inherited from class infer.Infer |
---|
db, grounding, mln, options |
Constructor Summary | |
---|---|
Learner()
|
Method Summary | |
---|---|
void |
dumpAnswers()
Output the learning result to file CommandOptions.fout . |
void |
fillInCurrentWeight(MCSAT _mcsat)
Init. |
abstract void |
loadingTrainingData(MCSAT _mcsat)
Reading from training data and fill it into MRF.atoms . |
void |
run(CommandOptions opt)
run the learner |
abstract boolean |
updateWeight(MCSAT mcsat)
Update currentWeight to new weights
according to information provided by mcsat instance, e.g.,
MCSAT.expectationOfViolation ; This is a virtual
function, each instance of Learner should materialize
an adhoc version of this function. |
double |
validatingLearningPerformance(MCSAT mcsat,
MCSAT _mcsat)
DEBUG ONLY!. |
Methods inherited from class infer.Infer |
---|
cleanUp, ground, loadMLN, setUp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int backtrackCount_
public boolean backtracked
public static java.util.HashMap<java.lang.String,java.lang.Double> currentD
public static java.util.HashMap<java.lang.String,java.lang.Double> currentWeight
public static java.util.HashMap<java.lang.String,java.lang.Double> finalWeight
public boolean isFirstTime
public static java.util.HashMap<java.lang.String,java.lang.Boolean> isHardMappings
public double odds
public java.util.HashMap<java.lang.String,java.lang.Double> oldWeight
public java.util.HashMap<java.lang.String,java.lang.Integer> trainingSatisification
public java.util.HashMap<java.lang.String,java.lang.Integer> trainingViolation
Constructor Detail |
---|
public Learner()
Method Detail |
---|
public void dumpAnswers()
CommandOptions.fout
.
public void fillInCurrentWeight(MCSAT _mcsat)
_mcsat
- MCSAT instance containing the vio/sat
informaiton.public abstract void loadingTrainingData(MCSAT _mcsat)
MRF.atoms
.
This function should be materialized by an instance
of abstract class Learner.
_mcsat
- The MCSAT object to be filled in.public void run(CommandOptions opt) throws java.sql.SQLException
opt
- Command line Options
java.sql.SQLException
public abstract boolean updateWeight(MCSAT mcsat)
currentWeight
to new weights
according to information provided by mcsat instance, e.g.,
MCSAT.expectationOfViolation
; This is a virtual
function, each instance of Learner
should materialize
an adhoc version of this function. This function should return
whether it think this iteration should terminate.
mcsat
- MCSAT instance after this iteration.
public double validatingLearningPerformance(MCSAT mcsat, MCSAT _mcsat)
mcsat
- MCSAT instance after this iteration._mcsat
- MCSAT instance saving training data.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |