title: Deeplearning4j difficulty using LibSVM files with CNNs
body: <p>I am using the LibSVM record reader to load sparse data into neural networks.</p>
  
  <p>This worked fine when using a MLP model, but when I tried to load data into one of the example CNNs given in one of the problems:</p>
  
  <pre><code>ComputationGraphConfiguration config = new NeuralNetConfiguration.Builder()
              .trainingWorkspaceMode(WorkspaceMode.SINGLE).inferenceWorkspaceMode(WorkspaceMode.SINGLE)
              //.trainingWorkspaceMode(WorkspaceMode.SEPARATE).inferenceWorkspaceMode(WorkspaceMode.SEPARATE)
              .weightInit(WeightInit.RELU)
              .activation(Activation.LEAKYRELU)
              .updater(Updater.ADAM)
              .convolutionMode(ConvolutionMode.Same)
              .regularization(true).l2(0.0001)
              .learningRate(0.01)
              .graphBuilder()
              .addInputs("input")
              .addLayer("cnn3", new ConvolutionLayer.Builder()
                  .kernelSize(3, vectorSize)
                  .stride(1, vectorSize)
                  .nIn(1)
                  .nOut(cnnLayerFeatureMaps)
                  .build(), "input")
              .addLayer("cnn4", new ConvolutionLayer.Builder()
                  .kernelSize(4, vectorSize)
                  .stride(1, vectorSize)
                  .nIn(1)
                  .nOut(cnnLayerFeatureMaps)
                  .build(), "input")
              .addLayer("cnn5", new ConvolutionLayer.Builder()
                      .kernelSize(5, vectorSize)
                      .stride(1, vectorSize)
                      .nIn(1)
                      .nOut(cnnLayerFeatureMaps)
                      .build(), "input")
              .addVertex("merger", new MergeVertex(), "cnn3", "cnn4", "cnn5")
              .addLayer("globalPool", new GlobalPoolingLayer.Builder()
                      .poolingType(globalPoolingType)
                      .dropOut(0.5)
                      .build(), "merger")
              .addLayer("out", new OutputLayer.Builder()
                      .lossFunction(LossFunctions.LossFunction.MCXENT)
                      .activation(Activation.SOFTMAX)
                      .nIn(3*cnnLayerFeatureMaps)
                      .nOut(classes.length)
                      .build(), "globalPool")
              .setOutputs("out")
              .setInputTypes(InputType.convolutionalFlat(32,45623,1))
              .build();
  </code></pre>
  
  <p>I got an error that seems to be saying that it was getting 2-dimensional data, but it needs 3-dimensional data (with the third dimension being a trivial one).</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: Invalid input: expect output columns must be equal to rows 32 x columns 45623 x channels 1 but was instead [32, 45623]
  </code></pre>
  
  <p>How do I give it the 1 channel dimension?</p>
  
  <p>Failing that, how do I get the CNN to recognize channel-less data, or how do I give a CNN sparse data?</p>
  
  <p>Thank you</p>