public class OWLQN
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
OWLQN.WeightsPrinter |
| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.Integer> |
biasParameters |
| Constructor and Description |
|---|
OWLQN() |
OWLQN(boolean quiet) |
OWLQN(cmu.arktweetnlp.impl.OWLQN.TerminationCriterion termCrit,
boolean quiet) |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxIters() |
static boolean |
isConstrained() |
double[] |
minimize(edu.stanford.nlp.optimization.DiffFunction function,
double[] initial,
double l1weight,
double tol,
int m) |
static double[] |
project(double[] c)
Implementation of the (Michelot 1986) technique for projecting
a real vector into the feasible region K defined by the following constraints:
- components must sum to 1, and
- they must be nonnegative.
|
protected static double[] |
projectWeights(double[] c)
Projects the full weight vector into the feasible region where constrains are operative only on a subset of weights.
|
static void |
setConstrained(boolean constrained)
Sets
constrained |
static void |
setConstrained(int numUnconstrainedWeights)
Specify that each parameter vector will start with numUnconstrainedWeights; only the
remaining weights are subject to the constraints.
|
void |
setMaxIters(int maxIters) |
void |
setQuiet(boolean q) |
void |
setWeightsPrinting(OWLQN.WeightsPrinter printer)
Specify a callback for printing the weights after each iteration of optimization.
|
public OWLQN(boolean quiet)
public OWLQN()
public OWLQN(cmu.arktweetnlp.impl.OWLQN.TerminationCriterion termCrit,
boolean quiet)
public void setQuiet(boolean q)
public double[] minimize(edu.stanford.nlp.optimization.DiffFunction function,
double[] initial,
double l1weight,
double tol,
int m)
public void setMaxIters(int maxIters)
public int getMaxIters()
public void setWeightsPrinting(OWLQN.WeightsPrinter printer)
public static void setConstrained(boolean constrained)
constrainedpublic static void setConstrained(int numUnconstrainedWeights)
public static boolean isConstrained()
protected static double[] projectWeights(double[] c)
public static double[] project(double[] c)
Given: a real vector c to be projected into a linearly-constrained subspace
I ← ∅ // index set
x ← c
do
Compute x' = P_V_I(x): x'_i =
0 if i ∈ I,
x_i - (1/(dim(c)-dim(I))) * (Σ_j { x_j } - 1) otherwise
if x' ≥ 0: return x'
I ← I ∪ {i | x'_i < 0}
x ← P_X_I(x'): i.e. x' but with any negative components replaced by 0
repeat
Output: projection of c into constrained subspace K, i.e. P_K(c)