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

Where can I find the installed header files for DL4J - INDArray related operations?

I have installed DL4J using maven. I need to see the installed .so and CPP header files that are used for INDArray calls? If I am not wrong the EXPORT functions are in NativeOps.h file. Where can I find them? I think they are located inside…
0
votes
0 answers

Implement DotProduct layer in DeepLearning4j

I am trying to implement a dot product layer but it doesn't seem to work correctly. Here's a couple of implementations I have so far Implementation 1 // dot product of betas and factors graphBuilder.addVertex("layer_product_", …
harshvardhan.agr
  • 165
  • 1
  • 12
0
votes
1 answer

ND4J: Why random numbers are different with even when specified same seed?

I want to generate same sent of random number when a fixed seed is given. For that, I have found some classes from nd4j documentation. But the generated random number is different. What can be the reason and how to achieve same set of random numbers…
foobar
  • 571
  • 1
  • 5
  • 20
0
votes
0 answers

IllegalStateException: ERROR: Unable to run session Expects arg[0] to be uint8 but int32 is provided || Unsupported data type: UBYTE

Trying to run RunGraphExample frozen_graph.pb on trained model Faster-RCNN with Tensorflow 1.13.1 , org.deeplearning4j "1.0.0-beta6" (Tensorflow 1.15) val data: Array[Array[Int]] = new Array[Array[Int]](img.getWidth * img.getHeight); for (i <- 0…
Alex Shcherbyna
  • 301
  • 4
  • 9
0
votes
1 answer

ND4J: Generate random number within range

If we want to create an INDArray of given rows and columns filled with random number between 0 and 1 we can use: Nd4j.rand(row, cols); But what if we want INDArray of given rows and columns filled with random number between -5000 and 5000?…
foobar
  • 571
  • 1
  • 5
  • 20
0
votes
3 answers

Nd4J: get index where a value exists

how to get index where a certain value exists. In numpy: import numpy as np myArr = np.array() index = np.where(myArr == someValue) // Output: an index value consisting rows and cols will be given In ND4J, I have reached here, but I dont know what…
foobar
  • 571
  • 1
  • 5
  • 20
0
votes
1 answer

how to calculate Euclidean distance between vectors of two INDArrays in ND4J?

I am trying to calculate euclidean distance between two INDArrays (supposing that INDArray is alternative of numpy array). In python, I have achieved this as: import numpy as np from scipy.spatial.distance import cdist arr1 = np.array(of some…
foobar
  • 571
  • 1
  • 5
  • 20
0
votes
1 answer

DL4J - Is there a way to restrict the prediction of a model

I trained a Mnist model with DL4J. When I use this model in inference mode: INDArray prediction = myModel.output(myINDArrayImage); That gives me a prediction in an INDArray, it works properly. The size of this INDArray is equal to number of output…
0
votes
1 answer

How to copy a smaller INDArray to a bigger one

I have an INDArray with shape {7,2,3}. I would like to increase one or more of the dimensions {8,3,4} or {7,3,3}, etc and insert the values into the resized array. I understand that the same array cannot be resized to increase length so I intend to…
user4790067
  • 451
  • 2
  • 6
  • 12
0
votes
2 answers

error: ambiguous reference to overloaded definition, ND4J in scala

I am trying to create an INDArray of zeros with the following code: var testArray = Nd4j.zeros(3,4) However I got the following error: :71: error: ambiguous reference to overloaded definition, both method zeros in object Nd4j of type (x$1:…
0
votes
0 answers

Correct initialization of ImageRecordReader(long height, long width, long channels) for the larger size images in DL4J

I have the jpeg images much wider and higher than values, I'm passing with ImageRecordReader(long height, long width, long channels), say ImageRecordReader(100, 100, 1), while the images themselves are 2000x3000 pixels size and have 3 channels. Will…
Eljah
  • 4,188
  • 4
  • 41
  • 85
0
votes
2 answers

Intellij Maven deeplearning4j

I am trying to set up a maven project in IntelliJ and I need complete up to date instructions on how to do the set up for deeplearning4j because I keep running into errors such as: java.lang.NoClassDefFoundError: Could not initialize class …
0
votes
1 answer

Nd4j INDArray from boolean to int

If I have this array (its an INDArray but I'm simplifying the view) myArray = [[0, 0.7], [0, 0]], and I do this res = myArray.eq(0.7) I get res = [[false, true], [false, false]] Is there a Nd4j method that can convert boolean INDArrays to 0/1 Arrays…
plguillou
  • 38
  • 4
0
votes
2 answers

Errors when trying to run Nd4j with Cuda

I've followed about every tutorial I could find, but somehow I can't seem to get Nd4j to work with a Cuda backend. I think I'm missing a library, but I can't figure out which one or where to download it. The error I'm getting is: 18:23:23.872 [main]…
hinsbergen
  • 147
  • 2
  • 11
0
votes
1 answer

org.deeplearning4j.exception.DL4JInvalidInputException: Problem with creating array with data to predict

When I run below code: model.output(samples).getDouble(0); I receive error: org.deeplearning4j.exception.DL4JInvalidInputException: Cannot do forward pass in Convolution layer (layer name = conv1d_1, layer index = 0): input array channels does not…
yaw
  • 303
  • 2
  • 11