Available Methods
- putScalar ( )
- length ( )
- dup ( )
- get ( )
- size ( )
- shape ( )
- assign ( )
- rows ( )
- getDouble ( )
- reshape ( )
- addi ( )
- muli ( )
- rank ( )
- mmul ( )
- columns ( )
- put ( )
- lengthLong ( )
- ordering ( )
- sum ( )
- mul ( )
- putRow ( )
- getRow ( )
- divi ( )
- castTo ( )
- permute ( )
- mean ( )
- add ( )
- slice ( )
- sub ( )
- tensorAlongDimension ( )
- muliColumnVector ( )
- dataType ( )
- addiRowVector ( )
- transpose ( )
- isVector ( )
- subi ( )
- getInt ( )
- isView ( )
- isScalar ( )
- subiRowVector ( )
- std ( )
- getFloat ( )
- diviColumnVector ( )
- stride ( )
- slices ( )
- max ( )
- muliRowVector ( )
- data ( )
- getColumn ( )
- equalShapes ( )
- div ( )
- rsubi ( )
- equals ( )
- rsub ( )
- isEmpty ( )
- var ( )
- elementWiseStride ( )
- markAsCompressed ( )
- norm2 ( )
- mmuli ( )
- getColumns ( )
- linearView ( )
- diviRowVector ( )
- isRowVector ( )
- isSparse ( )
- like ( )
- ulike ( )
- offset ( )
- unsafeDuplication ( )
- putSlice ( )
- isRowVectorOrScalar ( )
- equalsWithEps ( )
- rdivi ( )
- addiColumnVector ( )
- setData ( )
- gt ( )
- rdiv ( )
- tensorsAlongDimension ( )
- toString ( )
- vectorsAlongDimension ( )
- mulColumnVector ( )
- detach ( )
- close ( )
- tensorssAlongDimension ( )
- putColumn ( )
- javaTensorAlongDimension ( )
- isCompressed ( )
- norm1 ( )
- getRows ( )
- ravel ( )
- broadcast ( )
- isMatrix ( )
- mulRowVector ( )
- addColumnVector ( )
- toFloatVector ( )
- dimShuffle ( )
- isR ( )
- min ( )
- negi ( )
- isS ( )
- addRowVector ( )
- vectorAlongDimension ( )
- isColumnVectorOrScalar ( )
- isAttached ( )
- distance2 ( )
- shapeInfoDataBuffer ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.util.Random
- java.nio.ByteBuffer
- org.junit.Ignore
- org.apache.spark.api.java.JavaRDD
- org.nd4j.linalg.factory.Nd4j
- org.deeplearning4j.nn.conf.NeuralNetConfiguration
- org.deeplearning4j.nn.weights.WeightInit
- org.deeplearning4j.nn.multilayer.MultiLayerNetwork
- org.deeplearning4j.nn.conf.layers.DenseLayer
- org.deeplearning4j.nn.conf.layers.OutputLayer
- org.nd4j.linalg.activations.Activation
- org.deeplearning4j.nn.conf.MultiLayerConfiguration
- org.nd4j.linalg.lossfunctions.LossFunctions
- org.nd4j.linalg.dataset.DataSet
- org.deeplearning4j.nn.api.OptimizationAlgorithm
- org.nd4j.linalg.dataset.api.iterator.DataSetIterator
- org.deeplearning4j.nn.graph.ComputationGraph
- org.nd4j.linalg.ops.transforms.Transforms
- org.deeplearning4j.nn.conf.inputs.InputType
- org.nd4j.linalg.indexing.NDArrayIndex
- org.nd4j.linalg.learning.config.Adam
- org.deeplearning4j.nn.conf.ComputationGraphConfiguration
Java Code Examples for org.nd4j.linalg.api.ndarray.INDArray#dimShuffle()
The following examples show how to use
org.nd4j.linalg.api.ndarray.INDArray#dimShuffle() .
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: ShapeTests.java From nd4j with Apache License 2.0 | 6 votes |
@Test public void testDimShuffle() { INDArray scalarTest = Nd4j.scalar(0.0); INDArray broadcast = scalarTest.dimShuffle(new Object[] {'x'}, new long[] {0, 1}, new boolean[] {true, true}); assertTrue(broadcast.rank() == 3); INDArray rowVector = Nd4j.linspace(1, 4, 4); assertEquals(rowVector, rowVector.dimShuffle(new Object[] {0, 1}, new int[] {0, 1}, new boolean[] {false, false})); //add extra dimension to row vector in middle INDArray rearrangedRowVector = rowVector.dimShuffle(new Object[] {0, 'x', 1}, new int[] {0, 1}, new boolean[] {true, true}); assertArrayEquals(new long[] {1, 1, 4}, rearrangedRowVector.shape()); INDArray dimshuffed = rowVector.dimShuffle(new Object[] {'x', 0, 'x', 'x'}, new long[] {0, 1}, new boolean[] {true, true}); assertArrayEquals(new long[] {1, 1, 1, 1, 4}, dimshuffed.shape()); }
Example 2
Source File: ShapeTests.java From deeplearning4j with Apache License 2.0 | 6 votes |
@Test public void testDimShuffle() { INDArray scalarTest = Nd4j.scalar(0.0).reshape(1, -1); INDArray broadcast = scalarTest.dimShuffle(new Object[] {'x'}, new long[] {0, 1}, new boolean[] {true, true}); assertTrue(broadcast.rank() == 3); INDArray rowVector = Nd4j.linspace(1, 4, 4, DataType.DOUBLE).reshape(1, -1); assertEquals(rowVector, rowVector.dimShuffle(new Object[] {0, 1}, new int[] {0, 1}, new boolean[] {false, false})); //add extra dimension to row vector in middle INDArray rearrangedRowVector = rowVector.dimShuffle(new Object[] {0, 'x', 1}, new int[] {0, 1}, new boolean[] {true, true}); assertArrayEquals(new long[] {1, 1, 4}, rearrangedRowVector.shape()); INDArray dimshuffed = rowVector.dimShuffle(new Object[] {'x', 0, 'x', 'x'}, new long[] {0, 1}, new boolean[] {true, true}); assertArrayEquals(new long[] {1, 1, 1, 1, 4}, dimshuffed.shape()); }
Example 3
Source File: NDArrayTestsFortran.java From nd4j with Apache License 2.0 | 5 votes |
@Test public void testDimShuffle() { INDArray n = Nd4j.linspace(1, 4, 4).reshape(2, 2); INDArray twoOneTwo = n.dimShuffle(new Object[] {0, 'x', 1}, new int[] {0, 1}, new boolean[] {false, false}); assertTrue(Arrays.equals(new long[] {2, 1, 2}, twoOneTwo.shape())); INDArray reverse = n.dimShuffle(new Object[] {1, 'x', 0}, new int[] {1, 0}, new boolean[] {false, false}); assertTrue(Arrays.equals(new long[] {2, 1, 2}, reverse.shape())); }
Example 4
Source File: NDArrayTestsFortran.java From deeplearning4j with Apache License 2.0 | 5 votes |
@Test public void testDimShuffle() { INDArray n = Nd4j.linspace(1, 4, 4, DataType.DOUBLE).reshape(2, 2); INDArray twoOneTwo = n.dimShuffle(new Object[] {0, 'x', 1}, new int[] {0, 1}, new boolean[] {false, false}); assertTrue(Arrays.equals(new long[] {2, 1, 2}, twoOneTwo.shape())); INDArray reverse = n.dimShuffle(new Object[] {1, 'x', 0}, new int[] {1, 0}, new boolean[] {false, false}); assertTrue(Arrays.equals(new long[] {2, 1, 2}, reverse.shape())); }