public class PLNetInputOptimizer
extends java.lang.Object
InputOptimizerLoss) with respect to the input of a PLNet using gradient descent.
Assumes the PLNet was trained on normalized training data (i.e. scaled to intervals of 0 to 1 using DyadMinMaxScaler)
and ensures that the optimized inputs will be within this range.| Constructor and Description |
|---|
PLNetInputOptimizer() |
| Modifier and Type | Method and Description |
|---|---|
org.nd4j.linalg.api.ndarray.INDArray |
optimizeInput(PLNetDyadRanker plNet,
org.nd4j.linalg.api.ndarray.INDArray input,
InputOptimizerLoss loss,
double initialLearningRate,
double finalLearningRate,
int numSteps,
org.nd4j.linalg.api.ndarray.INDArray inputMask)
Optimizes the given loss function with respect to a given PLNet's inputs using gradient descent.
|
org.nd4j.linalg.api.ndarray.INDArray |
optimizeInput(PLNetDyadRanker plNet,
org.nd4j.linalg.api.ndarray.INDArray input,
InputOptimizerLoss loss,
double initialLearningRate,
double finalLearningRate,
int numSteps,
org.nd4j.linalg.primitives.Pair<java.lang.Integer,java.lang.Integer> indexRange)
Optimizes the given loss function with respect to a given PLNet's inputs using gradient descent.
|
org.nd4j.linalg.api.ndarray.INDArray |
optimizeInput(PLNetDyadRanker plNet,
org.nd4j.linalg.api.ndarray.INDArray input,
InputOptimizerLoss loss,
double learningRate,
int numSteps,
org.nd4j.linalg.api.ndarray.INDArray inputMask)
Optimizes the given loss function with respect to a given PLNet's inputs using gradient descent.
|
org.nd4j.linalg.api.ndarray.INDArray |
optimizeInput(PLNetDyadRanker plNet,
org.nd4j.linalg.api.ndarray.INDArray input,
InputOptimizerLoss loss,
double learningRate,
int numSteps,
org.nd4j.linalg.primitives.Pair<java.lang.Integer,java.lang.Integer> indexRange)
Optimizes the given loss function with respect to a given PLNet's inputs using gradient descent.
|
void |
setListener(InputOptListener listener)
Set an
InputOptListener to record the intermediate steps of the optimization procedure. |
public org.nd4j.linalg.api.ndarray.INDArray optimizeInput(PLNetDyadRanker plNet, org.nd4j.linalg.api.ndarray.INDArray input, InputOptimizerLoss loss, double learningRate, int numSteps, org.nd4j.linalg.primitives.Pair<java.lang.Integer,java.lang.Integer> indexRange)
Pair} of integers.plNet - PLNet whose inputs to optimize.input - Initial inputs to start the gradient descent procedure from.loss - The loss to be minimized.learningRate - The initial learning rate.numSteps - The number of steps to perform gradient descent for.indexRange - Pair of indices (inclusive) specifying the parts of the input that should be optimized.public org.nd4j.linalg.api.ndarray.INDArray optimizeInput(PLNetDyadRanker plNet, org.nd4j.linalg.api.ndarray.INDArray input, InputOptimizerLoss loss, double initialLearningRate, double finalLearningRate, int numSteps, org.nd4j.linalg.primitives.Pair<java.lang.Integer,java.lang.Integer> indexRange)
Pair} of integers.plNet - PLNet whose inputs to optimize.input - Initial inputs to start the gradient descent procedure from.loss - The loss to be minimized.initialLearningRate - The initial learning rate.finalLearningRate - The value the learning rate should decay to.numSteps - The number of steps to perform gradient descent for.indexRange - Pair of indices (inclusive) specifying the parts of the input that should be optimized.public org.nd4j.linalg.api.ndarray.INDArray optimizeInput(PLNetDyadRanker plNet, org.nd4j.linalg.api.ndarray.INDArray input, InputOptimizerLoss loss, double learningRate, int numSteps, org.nd4j.linalg.api.ndarray.INDArray inputMask)
plNet - PLNet whose inputs to optimize.input - Initial inputs to start the gradient descent procedure from.loss - The loss to be minimized.learningRate - The initial learning rate.numSteps - The number of steps to perform gradient descent for.inputMask - 0,1 vector specifying the inputs to optimize, i.e. should have a 1 at the index of any input that should be optimized and a 0 elsewhere.public org.nd4j.linalg.api.ndarray.INDArray optimizeInput(PLNetDyadRanker plNet, org.nd4j.linalg.api.ndarray.INDArray input, InputOptimizerLoss loss, double initialLearningRate, double finalLearningRate, int numSteps, org.nd4j.linalg.api.ndarray.INDArray inputMask)
plNet - PLNet whose inputs to optimize.input - Initial inputs to start the gradient descent procedure from.loss - The loss to be minimized.initialLearningRate - The initial learning rate.finalLearningRate - The value the learning rate should decay to.numSteps - The number of steps to perform gradient descent for.inputMask - 0,1 vector specifying the inputs to optimize, i.e. should have a 1 at the index of any input that should be optimized and a 0 elsewhere.public void setListener(InputOptListener listener)
InputOptListener to record the intermediate steps of the optimization procedure.listener -