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
1
vote
1 answer

ND4J DL4J Getting data into fit method

I have an INDArray of data which is the return value of x as follows: private static INDArray createDataSet(String path)throws Exception { List lines = IOUtils.readLines(new FileInputStream(path), StandardCharsets.UTF_8); …
cagney
  • 492
  • 3
  • 11
1
vote
0 answers

java.lang.NoClassDefFoundError: org/nd4j/linalg/api/ops/impl/transforms/floating/Histogram

Why I'm getting error java.lang.NoClassDefFoundError: org/nd4j/linalg/api/ops/impl/transforms/floating/Histogram while trying to set up the listener like gan.setListeners(new StatsListener(statsStorage)); for the GAN network like this (from the…
Eljah
  • 4,188
  • 4
  • 41
  • 85
1
vote
1 answer

Can't read even though there is dylib symbol

I get this error when running my java program. (on intellij ide.) dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address Referenced from:…
1
vote
2 answers

How to read numpy array in ND4j

I have too components that deal with n-dimension array. One component is written in python which process the data and save the processed ndarray by tobytes(). Now the other component is written in java, which need to read the serialized ndarray…
Alfred
  • 1,709
  • 8
  • 23
  • 38
1
vote
1 answer

Is there an INDArray's method to perform an addition of two INDArray (with different size)?

Imagine two INDArray: a1.shape() = [2, 3] and a1 is full of 1; a2.shape() = [1, 2] and a2 is full of 2. I would like to perform an addition between them such as: ?> result = a1.add(0, a2) ?> print(result) [[3, 3, 1], [1, 1, 1]] ?> result =…
Theophile Champion
  • 453
  • 1
  • 4
  • 20
1
vote
1 answer

How to store Lists of INDArray in a DataSet

For a reinforcement-learing I create two List with states and the corresponing move predicton and reward value. How can I transform this two Lists into one org.nd4j.linalg.dataset.api.DataSet
Ackdari
  • 3,222
  • 1
  • 16
  • 33
1
vote
1 answer

Does ND4J slicing make a copy of the original array?

ND4J INDArray slicing is achieved through one of the overloaded get() methods as answered in java - Get an arbitrary slice of a Nd4j array - Stack Overflow. As an INDArray takes a continuous block of native memory, does slicing using get() make a…
Shreck Ye
  • 1,591
  • 2
  • 16
  • 32
1
vote
1 answer

matrix multiplication broadcast in nd4j

In python, assume a = np.array(range(0,12)).reshape(2,2,3) b = np.array(range(0,6)).reshape(3,2) c = np.matmul(a,b) // a @ b We have a: array([[[ 0, 1, 2], [ 3, 4, 5]], [[ 6, 7, 8], [ 9, 10, 11]]]) b: array([[0, 1], …
Xiang Liu
  • 43
  • 6
1
vote
0 answers

DL4J attempting to use cpu instead of cuda

I've been running a DL4J project on my laptop using my mobile gpu. It runs fine, the gpu is detected and my models get trained. But after switching to a desktop with discrete graphics, the same program attempts to use the cpu! Both machines are…
1
vote
1 answer

ND4J JUnit Testing Exceptions

I have written a simple class and test it manually in main() and works as expected: import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.factory.Nd4j; public class ND4J { public static void main(String[] args) { ND4J…
shanlodh
  • 1,015
  • 2
  • 11
  • 30
1
vote
1 answer

Convert ND4J INDArray to a List

I'm searching how I can convert a INDArray of N lines and 1 column to a List (ArrayList or something else, doesn't matter) object. I could cast multiple times the object, using myIndarray.data() to get a DataBuffer, then transform the DataBuffer to…
Be Chiller Too
  • 2,502
  • 2
  • 16
  • 42
1
vote
1 answer

PCA fails with ND4J: BLAS not found?

I'm using ND4J on Windows to do a PCA on a matrix, but I think ND4J can't find the BLAS library. I installed OpenBLAS with minGW (make then make PREFIX=C:/OpenBLAS install), and added C:\OpenBLAS\bin (where libopenblas.dll is) to the PATH…
Be Chiller Too
  • 2,502
  • 2
  • 16
  • 42
1
vote
0 answers

ND4J libraries fail to load on initialization: Unsatisfied Link Error

I'm making a program with deep4j and I'm having libraries issues when I try to initialize the program. It is saying that I am not able to load the libraries besides the fact I seem to have set the library path manually in the Java code…
andor kesselman
  • 1,089
  • 2
  • 15
  • 26
1
vote
1 answer

Implementation of image pre-processing methods on android

Could you please suggest a library (or a snippet) to implement pre-processing Python methods (e.g. numpy.expand_dims() or img_to_array) on Android API 18 (to deploy an app based on TensorFlow Mobile)? There are analogous libraries to Python on Java…
A. Gimal
  • 15
  • 4
1
vote
1 answer

Input Spark Dataframe to DeepLearning4J model

I've data in my spark dataframe (df) which have 24 features and the 25th column is my target variable. I want to fit my dl4j model on this dataset which takes input in the form of org.nd4j.linalg.api.ndarray.INDArray, …
Ishan
  • 996
  • 3
  • 13
  • 34