want to adapt deeplearning4j example of UCISequenceClassification: https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/quickstart/modeling/recurrent/UCISequenceClassification.java. The example contains one feature with one label. I want to use that example in another project in exactly same way, but... with an additional feature. So I tried to add a feature (just for the example: with constant value 1 which I added to code). I tried multiple ways without success. Does anyone know how to add a feature? I assume I has to choose another SequenceRecordReader? Here my first try:
Manipulate Input - Replace this:
for (String line : lines) {
String transposed = line.replaceAll(" +", "\n"); // HERE WILL BE THE CHANGE(!!!)
//Labels: first 100 quickstartexamples (lines) are label 0, second 100 quickstartexamples are label 1, and so on
contentAndLabels.add(new Pair<>(transposed, lineCount++ / 100));
}
Manipulate inputs (add one feature) - By this:
for (String line : lines) {
String transposed = line.replaceAll(" +", "|1\n"); // HERE IS THE CHANGE(!!!). I ADD VALUE 1
//Labels: first 100 quickstartexamples (lines) are label 0, second 100 quickstartexamples are label 1, and so on
contentAndLabels.add(new Pair<>(transposed, lineCount++ / 100));
}
Now my try to add the feature: Original:
SequenceRecordReader trainFeatures = new CSVSequenceRecordReader();
trainFeatures.initialize(new NumberedFileInputSplit(featuresDirTrain.getAbsolutePath() + "/%d.csv", 0, 449));
My change:
SequenceRecordReader trainFeatures2 = new CSVMultiSequenceRecordReader("|",Mode.EQUAL_LENGTH);
trainFeatures2.initialize(new NumberedFileInputSplit(featuresDirTrain.getAbsolutePath() + "/%d.csv", 0, 449));
Unfortunatelly this does not work, because he is not building the dataset in correct form.
So main question I need to solve: How to change SequenceRecordReader to include a second or multiple features? Maybe using another Reader instead of CSVMultiSequenceRecordReader? Or wrong usage?
Thanks for any hints.
(Hint: Please no comment about the static value 1 :-). This should just represanting my example. It will be replaced by another int value which make sense)