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
0 answers

deeplearning4j creating NDArray for CNN training

I am trying to implement a channel for a CNN, this channel is to split a sentence into x number of parts. Each of these parts then gains a sentiment score, and the parts are fed into the CNN. I however don't understand how I can turn these part…
rj93
  • 523
  • 8
  • 25
1
vote
1 answer

Bad INDArray creation performance using DeepLearning4J

As part of a larger piece of code, I am using this INDArray imageArray = Nd4j.create(rgbValues); to create my input array for getting an output from my already-trained neural network. rgbValues is a single-dimensional array of approximately 10,000…
Anon10W1z
  • 167
  • 10
1
vote
1 answer

Can't build ParagraphVectors in Linux

I'm using the Doc2Vec algorithm with Deeplearning4j and it works fine when I run it on my Windows 10 PC, however when I try to run it on a Linux box, i get the following error: java.lang.NoClassDefFoundError: Could not initialize class…
A Margolis
  • 13
  • 2
1
vote
1 answer

nd4j backend RuntimeException on android

I get the following RuntimeException: java.lang.RuntimeException: org.nd4j.linalg.factory.Nd4jBackend$NoAvailableBackendException: Please ensure that you have an nd4j backend on your classpath. Please see: http://nd4j.org/getstarted.html it seems…
Tzachi
  • 11
  • 2
1
vote
0 answers

Trying to run an app using dl4j on Android

I am trying to run a simple app using the deep learning library dl4j. I am working on Android Studio and using Gradle. During runtime, I get the following exception: 08-15 13:23:00.601 4868-4868/com.mi.dl E/AndroidRuntime: FATAL EXCEPTION: main …
faraopera
  • 39
  • 3
1
vote
2 answers

Deeplearning4j: LSTM example for review sentiment analysis

I am looking through the example of deeplearning 4j for classifying movie reviews according to their sentiment. ReviewExample At line 124-142 the N-dimensional arrays are created and I am kind of unsure what is happening at these lines: Line 132:…
toobee
  • 2,592
  • 4
  • 26
  • 35
1
vote
1 answer

Scala type mismatch while using Map

I was trying to create a map that goes from integers to Nd4j arrays (as in INDArrays) using the nd4s library. I'm struggling with this issue: import org.nd4j.linalg.factory._ scala> Map(0 -> Nd4j.create(2)) :17: error: type mismatch; found…
pygabriel
  • 9,840
  • 4
  • 41
  • 54
0
votes
1 answer

Create INDArray (ND4J) from csv or spark data frame

I want to use ND4J purely as linear algebra library and would like to create an INDArray directly from either a csv file or a spark dataframe without having to create an intermediate Java collection on-heap. I tried to find a solution everywhere but…
0
votes
1 answer

why can't Maven find the nd4j .jar file after adding the dependency to pom.xml?

I created a maven program in intellij-idea with openjdk-20, and I put the dependency for nd4j in the dependencies section in pom.xml, and imported nd4j.*, but when I ran the program, it raised this error: Could not find artifact…
someone
  • 122
  • 4
0
votes
0 answers

ND4J NoAvailableBackendException despite following all documentation steps

I have an annoying issue with ND4J while attempting to implement deeplearning4j into a project. As the title already says, it is a NoAvailableBackendException. I am getting this error with maven, the full pom.xml is here. The stacktrace is here. The…
0
votes
1 answer

Runtime Error From ND4J When Executing SVD

I'm playing with ND4J basics to come up to speed with its linear algebra capabilities. I'm running on a Macbook Pro using nd4j-api and nd4j-native dependencies version 1.0.0-M2.1, Open JDK version 17, Kotlin 1.7.20, and IntelliJ 2022.2.2 Ultimate…
duffymo
  • 305,152
  • 44
  • 369
  • 561
0
votes
2 answers

Problem Adding A Column Vector To A Matrix Using ND4J

I'm playing with ND4J basics to come up to speed with its linear algebra capabilities. I'm running on a Macbook Pro using nd4j-api and nd4j-native dependencies version 1.0.0-M2.1, Open JDK version 17, Kotlin 1.7.20, and IntelliJ 2022.2.2 Ultimate…
duffymo
  • 305,152
  • 44
  • 369
  • 561
0
votes
2 answers

Cannot resolve symbol 'linspace' in ND4j

I'm pretty new in Java. I would like to initiate an array using Nd4j library INDArray x = new Nd4j.linspace(0, 1, 100);, doing something like x = np.linspace(0, 1, 100) in Python. And I ran into an error java: cannot find symbol symbol: class…
Zézouille
  • 503
  • 6
  • 21
0
votes
1 answer

BooleanIndexing.replaceWhere Not Working Based On Type

I started working with ND4j recently and came upon an issue I don't have an explanation for. INDArray test = Nd4j.create(new double[] {1.0, 1.0, 2.0, 1.0}, new long[] {2, 2}, DataType.UINT16); BooleanIndexing.replaceWhere(test, 0.0,…
0
votes
1 answer

How do I install/use nd4j?

I've been working on a project for a while and determined that it would be made much faster with the use of nd4j. I have spent many hours trying to use this library, but I always find more dependencies and errors. I started in Processing, but when…