Questions tagged [nd4j]

ND4J and ND4S are scientific computing libraries for the JVM.

These Java libraries provide implementations of n-dimensional arrays and linear algebra algorithms with emphasis on performance for large arrays. Arrays are stored off heap with operations on arrays performed outside the JVM employing BLAS or Cuda and the system's GPU. Numpy and MATLAB were the inspiration according to the authors.

Useful Links:

120 questions
0
votes
1 answer

ND4J set values using boolean indexing and computation

I want to set values in an array based on an index and using a computation. In numpy I would write the following: array[array < 0] = 2 * array[array < 0] Can something like this be achieved with ND4J as well? Edit: And what about more complicated…
user2912328
  • 171
  • 10
0
votes
1 answer

Problems building using gradle with nd4j

I'm trying to build a module using nd4j. It builds fine with maven but not with gradle. I did an auto-conversion of the pom, I added the javacpp dependency by hand and it builds but the tests fail with link error no jniopenblas_nolapack in…
Erik
  • 2,013
  • 11
  • 17
0
votes
1 answer

Rounding INDArray upto certain precision

Looking for a similar type of function np.round_(in_array, decimals = 2) which can operate on INDArray in java. Basically want to round off all the digits in INDArray up to some precision. Ex : Given an array in_array = [.5538, 1.33354,…
Programmer
  • 165
  • 1
  • 1
  • 7
0
votes
1 answer

Can't create complex matrices in nd4j

I want to create a complex matrix in nd4j with the method `Nd4j.complexOnes(new int[]{1});`. Sadly I get the following error: Exception in thread "main" java.lang.UnsupportedOperationException at…
Felix
  • 21
  • 2
0
votes
1 answer

What is the output of the dl4j lstm neural network?

I am studying a text generation example https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/advanced/modelling/charmodelling/generatetext/GenerateTxtCharCompGraphModel.java. The…
0
votes
1 answer

org.nd4j.linalg.factory.Nd4j.zeros(long, long)

Trying to use io.github.ensozos.core.MPdistance.getMPdistance using Maven, I get the following error: Exception in thread "main" java.lang.NoSuchMethodError: 'org.nd4j.linalg.api.ndarray.INDArray org.nd4j.linalg.factory.Nd4j.zeros(long, long)' …
0
votes
0 answers

Getting error when importing a Keras model into DL4J - "Batch norm layer expected input of type CNN, CNN Flat or FF..."

I'm trying to import a Keras model trained in Python with DL4J and I'm getting the following error: 11:39:22.588 [main] Exception in thread "main" java.lang.IllegalStateException: Invalid input type: Batch norm layer expected input of type CNN, CNN…
0
votes
0 answers

Incorrect eigenvalues from ND4J decomposition

I've found that ND4J is returning incorrect eigenvalues: double[][] array = new double[][]{{1, 2, 1}, {6, -1, 0}, {-1, -2, -1}}; INDArray matrix = Nd4j.create(array); INDArray values = Eigen.symmetricGeneralizedEigenvalues(matrix); …
rocksNwaves
  • 5,331
  • 4
  • 38
  • 77
0
votes
0 answers

nd4j dataset change to zero when i use shuffle method

I am using DeepLearning4J and nd4j-cuda-10.2. all of the DataSet elements change to zero after I use the shuffle() method. I have traced the code and I think there is a problem with the registerAction() method. DataSet…
0
votes
3 answers

Getting Deeplearning4j exception

I am getting the following exception at runtime using the latest Deeplearning4j release. The exception cause is listed below. I do not get the full trace so not sure which class it is not finding. I am not sure where the log can be found for that…
Tony Anecito
  • 347
  • 2
  • 13
0
votes
1 answer

Some issues with using DeepLearning4J dlls

I am working with DeepLearning4J working with the 1.0.0-beta7 release. I am getting two errors at run time. jnind4jcpu.dll unsupported jni version 0xffffffff no nd4jcpu in java.library.path I setup a path to the to a folder where I have a few…
Tony Anecito
  • 347
  • 2
  • 13
0
votes
1 answer

how can I reverse the elements of a column of a matrix in ND4J?

I am trying to rewrite this line of python code in JAVA with ND4j library. data[index_odd] = tmp[::-1,:] It reverses the column's elements. (in other words, the order of rows) I used this line but apparently it just works when…
0
votes
1 answer

Reduction of numbers accuracy in ND4J

I have an array namely “real”. it has a vector of double numbers. I am trying to create an INDArray based on my vector. my code is below : double real_d = (double) ArrBD.get(0); INDArray real = Nd4j.create(real_d); It works but unfortunately, it…
0
votes
1 answer

Setup linear regression with a factorMatrix - DL4j

I have a factorMatrix of type INDArray which is xIn It contains of 5 columns [A, B, C, D, E] and another INDArray with 1 column [y] which is yIn For the ones who are familiar with MatLab I could use now: modelTrain = fitlm([XInSample yInSample] ,…
Anna Klein
  • 1,906
  • 4
  • 27
  • 56
0
votes
2 answers

dl4j lstm not successful

Im trying to copy the exrcise about halfway down the page on this link: https://d2l.ai/chapter_recurrent-neural-networks/sequence.html The exercise uses a sine function to create 1000 data points between -1 through 1 and use a recurrent network to…
cagney
  • 492
  • 3
  • 11