public class LogLikelihoodDifferentiableFunction extends AbstractDifferentiableFunction<GraphicalModel>
Generates (potentially noisy, no promises about exactness) gradients from a batch of examples that were provided to the system.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VARIABLE_TRAINING_VALUE |
Constructor and Description |
---|
LogLikelihoodDifferentiableFunction() |
Modifier and Type | Method and Description |
---|---|
double |
getSummaryForInstance(GraphicalModel model,
ConcatVector weights,
ConcatVector gradient)
Gets a summary of the log-likelihood of a singe model at a point
|
public static final java.lang.String VARIABLE_TRAINING_VALUE
public double getSummaryForInstance(GraphicalModel model, ConcatVector weights, ConcatVector gradient)
It assumes that the models have observations for training set as metadata in LogLikelihoodDifferentiableFunction.OBSERVATION_FOR_TRAINING. The models can also have observations fixed in CliqueTree.VARIABLE_OBSERVED_VALUE, but these will be considered fixed and will not be learned against.
getSummaryForInstance
in class AbstractDifferentiableFunction<GraphicalModel>
model
- the model to find the log-likelihood ofweights
- the weights to usegradient
- the gradient to use, will be updated by accumulating the gradient from this instance