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