Hi All,
I am newbie in DL4J. I tried to implement a simple CNN like this:
val conf = new NeuralNetConfiguration.Builder()
.seed(seed)
.updater(Updater.NESTEROVS)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.weightInit(WeightInit.XAVIER)
.list
.layer(0, new ConvolutionLayer.Builder()
.name("c1")
.kernelSize(5, numFeatures)
.convolutionMode(ConvolutionMode.Truncate)
.activation(Activation.RELU)
.nIn(1)
.nOut(32)
.build)
.layer(1, new OutputLayer.Builder(LossFunctions.LossFunction.MSE)
.nOut(nOut)
.dropOut(0.5)
.activation(Activation.IDENTITY)
.build)
.setInputType(InputType.convolutional(windowSize, numFeatures, 1))
.build
My first minibatch has size [batchSize, 1, windowSize, numFeatures]
, so compatible with the CNN. The problem now, that I got NaN
values from inference, thus the network does not learn… I want to use this network for time series prediction (trying this for first, then later going to RNN).
Do you have any idea, what causes the problem? The network gives sensible values after init, but after first iteration only NaN
values are outputed.
In the dependencies, I have 0.9.1 version
Thank you for your help in advance!