Questions tagged [dl4j]

Deeplearning4j is the first commercial-grade, open-source, distributed deep-learning library written for Java and Scala

About

Deeplearning4j is the first commercial-grade, open-source, distributed deep-learning library written for Java and Scala. Integrated with Hadoop and Spark, DL4J is designed to be used in business environments, rather than as a research tool.

Links

208 questions
0
votes
1 answer

Get input and output size for each layer in deeplearning4java

How to fetch the layer input and output size in dl4j ? For example, something like this : MultiLayerNetwork network = model.init() for(Layer layer : network.getLayers()) { int[] outputShape = layer.shape() }
0
votes
1 answer

DL4J: Wrong input size - expected matrix

I’m trying to get my network to evaluate an INDArray. This is my network: public class DQN { private final int inputSize; private final int outputSize; private final MultiLayerNetwork network; public DQN(int inputSize, int outputSize){ …
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

Validation loss is lower than training in FeedForward NN, DL4J

My problem is I am training my FeedForward NN to predict how long it takes to train from one to another station. It has two hidden layers (128 and 64) and using TANH. First what doesnt make sense for me is why my model predict better on validating…
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
2 answers

The center of a word vector

I'm studying NLP and wrapping my head around the steps of passing through a Multi-Layer Perceptron. Since vectors are magnitude and direction in a space, I'm curious what the center of a word vector represents. In a very simple vector, my word might…
DPCII
  • 118
  • 1
  • 6
0
votes
1 answer

I got Exception java.lang.NumberFormatException: For input string: "5.1" while reading csv

int numLinesToSkip = 0; char delimiter = ','; RecordReader recordReader = new CSVRecordReader(numLinesToSkip,delimiter); // recordReader.initialize(new FileSplit(new File(DownloaderUtility.IRISDATA.Download(),"iris.txt"))); …
0
votes
1 answer

How to change UIServer port for Deeplearning4j from 9000 to some other?

Currently I have a preconfigured VPN client that for some own sake uses exactly 9000 and there is no way to reconfigure it. How can I initiate dl4j's UIServer to some other port? UIServer is based on Eclipse Vert.x. I have been tried to set up…
Eljah
  • 4,188
  • 4
  • 41
  • 85
0
votes
1 answer

How to configure DL4j for local images

I'm trying to use DeepLearning4j to categorize 32x32 images in numbers from 0-9. I've looked up a number of examples and tutorials, but always run into some exception when fitting the dataset to a network. Im currently trying to use a…
Heliox
  • 11
  • 2
0
votes
2 answers

How can I load data from PostgreSQL into Deep Learning 4J?

Could you help to understand how can I load data from PostgreSQL into Deep Learning 4J, please? I'll appreciate if anyone have an example. Thanks in advance
Celso Marques
  • 378
  • 1
  • 4
  • 15
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 load Keras model file in DL4J that was trained in Python using a custom loss function

I am using a Keras model that was trained in Python in a Java process with DL4J. This has been generally working fine, but now moved to using a custom loss function. The model was trained in Python with a custom loss-function: model =…
Ch2231
  • 149
  • 1
  • 8
0
votes
0 answers

Iterations in DL4J?

From here and other sources TotalIteration = TotalExamples/Batchsize * Epochs. I have a CNN with 54 layers in total for 36000 examples, Batchsize of 12 and 3 Epochs. From the formula my Iteration is supposed to be 9000 but from the training-ui I am…
linker
  • 821
  • 1
  • 8
  • 20
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