Available Methods
- create ( )
- rand ( )
- exec ( )
- zeros ( )
- ones ( )
- linspace ( )
- createFromArray ( )
- createUninitialized ( )
- scalar ( )
- createBuffer ( )
- dataType ( )
- read ( )
- setDataType ( )
- order ( )
- getExecutioner ( )
- vstack ( )
- write ( )
- sizeOfDataType ( )
- valueArrayOf ( )
- randn ( )
- createArrayFromShapeBuffer ( )
- getStrides ( )
- getRandom ( )
- EPS_THRESHOLD
- createComplex ( )
- setDefaultDataTypes ( )
- hstack ( )
- concat ( )
- argMax ( )
- createTypedBuffer ( )
- createSparseCOO ( )
- pullRows ( )
- copy ( )
- shuffle ( )
- createDouble ( )
- defaultFloatingPointType ( )
- toFlattened ( )
- alloc ( )
- pile ( )
- getComplexStrides ( )
- zerosLike ( )
- empty ( )
- createBufferDetached ( )
- toNpyByteArray ( )
- createFromNpyFile ( )
- arange ( )
- ENFORCE_NUMERICAL_STABILITY
- gemm ( )
- averageAndPropagate ( )
- saveBinary ( )
- createSparseCSR ( )
- expandDims ( )
- sort ( )
- clearNans ( )
- tensorMmul ( )
- eye ( )
- append ( )
- createFromFlatArray ( )
- createComplexNumber ( )
- accumulate ( )
- readBinary ( )
- isFallbackModeEnabled ( )
- createFloat ( )
- MAX_SLICES_TO_PRINT
- writeComplex ( )
- createTypedBufferDetached ( )
- isExperimentalMode ( )
- trueScalar ( )
- createNpyFromByteArray ( )
- createFromNpzFile ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.util.Random
- java.nio.ByteBuffer
- org.junit.Ignore
- org.nd4j.linalg.api.ndarray.INDArray
- 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.bytedeco.javacpp.Pointer
- org.nd4j.linalg.indexing.NDArrayIndex
- org.nd4j.linalg.learning.config.Adam
- org.deeplearning4j.nn.conf.ComputationGraphConfiguration
Java Code Examples for org.nd4j.linalg.factory.Nd4j#createFloat()
The following examples show how to use
org.nd4j.linalg.factory.Nd4j#createFloat() .
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: ComplexNumberTests.java From nd4j with Apache License 2.0 | 6 votes |
@Test public void testScalarFloat() { IComplexFloat test = Nd4j.createFloat(1, 1); test.addi(1); assertEquals(2, test.realComponent().floatValue(), 1e-1); assertEquals(1, test.imaginaryComponent(), 1e-1); test.subi(1); assertEquals(1, test.realComponent().floatValue(), 1e-1); assertEquals(getFailureMessage(), 1, test.imaginaryComponent(), 1e-1); test.muli(2); assertEquals(2, test.realComponent().floatValue(), 1e-1); assertEquals(2, test.imaginaryComponent(), 1e-1); test.divi(2); assertEquals(1, test.realComponent().floatValue(), 1e-1); assertEquals(1, test.imaginaryComponent(), 1e-1); test.addi(Nd4j.createDouble(1, 1)); assertEquals(2, test.realComponent().floatValue(), 1e-1); assertEquals(2, test.imaginaryComponent(), 1e-1); test.rdivi(1); assertEquals(0.25d, test.realComponent().floatValue(), 1e-1); assertEquals(-0.25d, test.imaginaryComponent(), 1e-1); }
Example 2
Source File: BaseCudaDataBuffer.java From nd4j with Apache License 2.0 | 4 votes |
@Override public IComplexFloat getComplexFloat(long i) { return Nd4j.createFloat(getFloat(i), getFloat(i + 1)); }
Example 3
Source File: ComplexNumberTests.java From nd4j with Apache License 2.0 | 4 votes |
@Test public void testExponentFloat() { IComplexFloat test = Nd4j.createFloat(1, 1); assertEquals(test.realComponent(), 1.468694, 1e-3); assertEquals(test.imaginaryComponent(), 2.2873552, 1e-3); }
Example 4
Source File: ComplexUtil.java From nd4j with Apache License 2.0 | 2 votes |
/** * Returns the exp of a complex number: * Let r be the realComponent component and i be the imaginary * Let ret be the complex number returned * ret -> exp(r) * cos(i), exp(r) * sin(i) * where the first number is the realComponent component * and the second number is the imaginary component * * @param d the number to getFromOrigin the exp of * @return the exponential of this complex number */ public static IComplexFloat exp(IComplexFloat d) { return Nd4j.createFloat((float) FastMath.exp(d.realComponent()) * (float) FastMath.cos(d.imaginaryComponent()), (float) FastMath.exp(d.realComponent()) * (float) FastMath.sin(d.imaginaryComponent())); }