Hi, first I should say that I am new in DL4J.
I want to train a 1D CNN for a regression problem.
My input is a 10000 samples of 1D vector with the size of 2048 points. the output is 21 parameters.
I created the CNN, you can see at the end.
the input is a CSV (or NDArray, It does not matter, I can convert it), and output is a CSV file too. I wrote this piece of code for reading input but I do not know how i can load input and output together as DataSetIterator?!
RecordReader recordReader = new CSVRecordReader(0,',');
recordReader.initialize(new FileSplit(new File("D:\\deep fitting\\Labels.csv")));
DataSetIterator iterator = new RecordReaderDataSetIterator(recordReader,10000);
DataSet allData = iterator.next();
anthor thing that bears in my mind is using INDArrayDataSetIterator, but I do not know HOW?
I appriciate your help in advance
My Net:
MultiLayerConfiguration configuration = new NeuralNetConfiguration.Builder()
.seed(seed)
.updater(new AdaDelta())
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.weightInit(WeightInit.XAVIER)
.list()
.layer(new Convolution1DLayer.Builder().kernelSize(5).convolutionMode(ConvolutionMode.Same)
.nIn(1).nOut(16).build())
.layer(new Subsampling1DLayer.Builder().kernelSize(2).stride(2).poolingType(SubsamplingLayer.PoolingType.MAX).build())
.layer(new Convolution1DLayer.Builder().kernelSize(5).convolutionMode(ConvolutionMode.Same).activation(Activation.LEAKYRELU)
.nOut(32).build())
.layer(new Subsampling1DLayer.Builder().kernelSize(2).stride(2).build())
.layer(new Convolution1DLayer.Builder().kernelSize(5).convolutionMode(ConvolutionMode.Same).activation(Activation.LEAKYRELU)
.nOut(64).build())
.layer(new Subsampling1DLayer.Builder().kernelSize(2).stride(2).build())
.layer(new Convolution1DLayer.Builder().kernelSize(3).convolutionMode(ConvolutionMode.Same).activation(Activation.LEAKYRELU)
.nOut(128).build())
.layer(new Subsampling1DLayer.Builder().kernelSize(2).stride(2).build())
.layer(new Convolution1DLayer.Builder().kernelSize(3).convolutionMode(ConvolutionMode.Same).activation(Activation.LEAKYRELU)
.nOut(256).build())
.layer(new Subsampling1DLayer.Builder().kernelSize(2).stride(2).build())
.layer(new Convolution1DLayer.Builder().kernelSize(3).convolutionMode(ConvolutionMode.Same).activation(Activation.LEAKYRELU)
.nOut(512).build())
.layer(new Subsampling1DLayer.Builder().kernelSize(2).stride(2).build())
.layer(new DropoutLayer(0.2))
.layer(new DenseLayer.Builder().nOut(21).build())
.layer(new OutputLayer.Builder(LossFunctions.LossFunction.MSE)
.name("output")
.nOut(21)
.activation(Activation.IDENTITY).build())
.setInputType(InputType.convolutional(1,2048,1))
.build();
MultiLayerNetwork network = new MultiLayerNetwork(configuration);
network.init();