This seems like it should be simple but I haven’t seen any examples and my attempts are not working.
Suppose I have an input CSV file with 7 columns. The first six columns are ordinary numerical data but the final column is categorical. It seems the way to handle this would be something like this
MultiDataSetIterator mdsi = new RecordReaderMultiDataSetIterator.Builder(batchSize)
.addReader("csvData", csvInputReader)
.addInput("csvData", 0, 5)
.addInputOneHot("csvData", 6, numClasses)
.
. //add reader for labels, output layer, etc
.
.build();
and then in setting up the ComputeGraph
ComputationGraphConfiguration cgc = new NeuralNetConfiguration.Builder()
.updater(new Sdg(1e-3))
.graphBuilder()
.addInputs("input0", "input1")
.addLayer("I0", new DenseLayer. Builder()
.nIn(inputSize)
.nOut(layer1Size)
.weightInit(WeightInit.ZERO)
.activation(Activation.SIGMOID)
.build(), "input0")
.addLayer("I1", new DenseLayer. Builder()
.nIn(inputSize)
.nOut(layer1Size)
.weightInit(WeightInit.ZERO)
.activation(Activation.SIGMOID)
.build(), "input1")
.addVertex("merge", new MergeVertex(), "I0", "I1")
.
.//add layers etc
.
.build();
Doing this will get me the error: Invalid input for layer (layer name = “I1”): input type is null
I thought I was adhering tot he closest example I could find from https://deeplearning4j.konduit.ai/models/computationgraph but what is wrong with my code here?