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
8
votes
2 answers

DL4J is super slow on GoogleNews-vectors file

I tried to execute the following example on DL4J (loading pre-trained vectors file): File gModel = new File("./GoogleNews-vectors-negative300.bin.gz"); Word2Vec vec = WordVectorSerializer.loadGoogleModel(gModel, true); InputStreamReader r = new…
6
votes
1 answer

Java best practices for vectorized computations

I'm researching methods for computing expensive vector operations in Java, e.g. dot-products or multiplications between large matrices. There are a few good threads on here on this topic, like this and this. It appears that there is no reliable way…
blackgreen
  • 34,072
  • 23
  • 111
  • 129
5
votes
1 answer

How to select a given set of indexes from an NDArray in ND4j similarly to numpy's arraydata[arrayIndex]?

I am developing a scientific application relying heavily on array manipulation in Java using ND4j (presently version 1.0.0-beta5). Throughout my pipeline, I have the need to dynamically select a non contiguous subset of a [2,195102] matrix (a few…
TimWetone
  • 53
  • 4
5
votes
1 answer

Compute covariance matrix using Nd4j

Given a 2 dimensional matrix, I'd like to compute the corresponding covariance matrix. Are there any methods included with Nd4j that would facilitate this operation? For example, the covariance matrix computed from the following matrix 1 2 8…
pgoggijr
  • 414
  • 1
  • 3
  • 15
5
votes
4 answers

How to setup scala sbt project for nd4j and deeplearning4j

I want to run the LSTM code from deeplearning4j examples in my own sbt project using scala. My setup is Ubuntu 14.04, sbt 0.13, Oracle Java 8, nd4j version 0.5.0, scala 2.11.8. My approach can be found in my git repo. Feel free to clone it. On…
Sebastian
  • 281
  • 1
  • 8
4
votes
1 answer

Excluding certain .jars from a Maven dependency from build by classifier

My project includes the nd4j-native-platform dependency, which includes .jars for windows, linux, and mac. The app is developed on windows/mac machines then deployed to Linux, so I'd like to save space on deployment by excluding these other…
allenfromspace
  • 120
  • 1
  • 13
4
votes
0 answers

Libraries not accessible for "classloader-namespace", when loading DL4J model using restoreMultiLayerNetwork()

I cannot find out how to get rid of / solve the below errors, that occur when loading a Neural Network model using the DL4J method restoreMultiLayerNetwork using Android API >= 24: The errors occur when the following line within the method…
Moritz
  • 1,710
  • 1
  • 8
  • 13
4
votes
3 answers

Java double to INDArray loses precision

I cannot convert double to Nd4j.INDArray without losing precision. double[] weight = new…
4
votes
1 answer

Reuse normalizer in ND4J/DL4J

I wonder what's the proper way to reuse a normalizer in ND4J/DL4J. Currently, I save it follows: final DataNormalization normalizer = new NormalizerStandardize(); normalizer.fit( trainingData ); normalizer.transform( trainingData…
beatngu13
  • 7,201
  • 6
  • 37
  • 66
4
votes
0 answers

Installing a BLAS implementation on CentOS 6.4 (Cloudera VM)

I'm using deeplearning4j and eclipse on CentOS 6.4 (x86_64). I have downloaded and tried to install intel MKL, OpenBLAS and ATLAS. Yet I'm still getting this error when I run my program: Mar 23, 2016 5:58:04 AM com.github.fommil.netlib.BLAS…
3
votes
1 answer

Get an arbitrary slice of a Nd4j array

I want to perform slicing in Nd4j of arbitrary sizes in the same manner as I am able to do using Numpy. a = numpy.arange(100) a[25:50] The nd4j slice method only takes dimension and index arguments, not length. How can I achieve this?
Mark Eastwood
  • 85
  • 1
  • 7
2
votes
2 answers

ND4j INDArray value indexing and boolean operation

Here is the numpy code: import numpy as np arr1 = np.array([[0, 1, np.nan], [3, np.nan, 5], [np.nan, 7, 8]]) arr2 = np.array([[np.nan, 7, 6], [5, np.nan, 3], [2, 1, np.nan]]) print(arr1) print(arr2) arr1 is: [[ 0. 1. nan] [ 3. nan 5.] [nan 7. …
xiagao1982
  • 1,077
  • 1
  • 13
  • 25
2
votes
0 answers

How to use LSTM with a 2d array with DeepLearning4j

i am trying to learn how to use LSTM with deeplearning4j lib. I created a dummy scenario where i want to get an output (3 classes) based on data that i collected. I got the data from here (http://www.osservatoriodioropa.it/meteoropa/NOAAMO.TXT) if…
user3804873
  • 155
  • 2
  • 11
2
votes
2 answers

Is Nd4j (Deeplearning4J) too large to actually use in an android mobile app?

After several weeks of development, I have finally created an AI in an Android App that works using the matrix manipulation API provided by the Nd4j library. These were imported into the project with gradle, following this…
2
votes
1 answer

How to get/build a JavaRDD[DataSet]?

When I use deeplearning4j and try to train a model in Spark public MultiLayerNetwork fit(JavaRDD trainingData) fit() need a JavaRDD parameter, I try to build like this val totalDaset = csv.map(row => { val features = Array( …
WaterEast
  • 21
  • 3
1
2 3 4 5 6 7 8