org.nd4j.linalg.learning.AdaDeltaUpdater Java Examples
The following examples show how to use
org.nd4j.linalg.learning.AdaDeltaUpdater.
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: AdaDeltaLearnerTestCase.java From jstarcraft-ai with Apache License 2.0 | 5 votes |
@Override protected GradientUpdater<?> getOldFunction(long[] shape) { AdaDelta configuration = new AdaDelta(); GradientUpdater<?> oldFunction = new AdaDeltaUpdater(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: AdaDelta.java From nd4j with Apache License 2.0 | 5 votes |
@Override public GradientUpdater instantiate(INDArray viewArray, boolean initializeViewArray) { AdaDeltaUpdater u = new AdaDeltaUpdater(this); long[] gradientShape = viewArray.shape(); gradientShape = Arrays.copyOf(gradientShape, gradientShape.length); gradientShape[1] /= 2; u.setStateViewArray(viewArray, gradientShape, viewArray.ordering(), initializeViewArray); return u; }
Example #3
Source File: AdaDelta.java From deeplearning4j with Apache License 2.0 | 5 votes |
@Override public GradientUpdater instantiate(INDArray viewArray, boolean initializeViewArray) { AdaDeltaUpdater u = new AdaDeltaUpdater(this); long[] gradientShape = viewArray.shape(); gradientShape = Arrays.copyOf(gradientShape, gradientShape.length); gradientShape[1] /= 2; u.setStateViewArray(viewArray, gradientShape, viewArray.ordering(), initializeViewArray); return u; }
Example #4
Source File: AdaDelta.java From deeplearning4j with Apache License 2.0 | 4 votes |
@Override public GradientUpdater instantiate(Map<String, INDArray> updaterState, boolean initializeStateArrays) { AdaDeltaUpdater u = new AdaDeltaUpdater(this); u.setState(updaterState, initializeStateArrays); return u; }