org.nd4j.linalg.learning.AdaGradUpdater Java Examples

The following examples show how to use org.nd4j.linalg.learning.AdaGradUpdater. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdaGradLearnerTestCase.java    From jstarcraft-ai with Apache License 2.0 5 votes vote down vote up
@Override
protected GradientUpdater<?> getOldFunction(long[] shape) {
    AdaGrad configuration = new AdaGrad();
    GradientUpdater<?> oldFunction = new AdaGradUpdater(configuration);
    int length = (int) (shape[0] * configuration.stateSize(shape[1]));
    INDArray view = Nd4j.zeros(length);
    oldFunction.setStateViewArray(view, shape, 'c', true);
    return oldFunction;
}
 
Example #2
Source File: AdaGrad.java    From nd4j with Apache License 2.0 4 votes vote down vote up
@Override
public GradientUpdater instantiate(INDArray viewArray, boolean initializeViewArray) {
    AdaGradUpdater u = new AdaGradUpdater(this);
    u.setStateViewArray(viewArray, viewArray.shape(), viewArray.ordering(), initializeViewArray);
    return u;
}
 
Example #3
Source File: AdaGrad.java    From deeplearning4j with Apache License 2.0 4 votes vote down vote up
@Override
public GradientUpdater instantiate(INDArray viewArray, boolean initializeViewArray) {
    AdaGradUpdater u = new AdaGradUpdater(this);
    u.setStateViewArray(viewArray, viewArray.shape(), viewArray.ordering(), initializeViewArray);
    return u;
}
 
Example #4
Source File: AdaGrad.java    From deeplearning4j with Apache License 2.0 4 votes vote down vote up
@Override
public GradientUpdater instantiate(Map<String, INDArray> updaterState, boolean initializeStateArrays) {
    AdaGradUpdater u = new AdaGradUpdater(this);
    u.setState(updaterState, initializeStateArrays);
    return u;
}