This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final KStream<String, String> inputEvents = builder.stream(inputTopic); | |
inputEvents.foreach((key, value) -> { | |
// Transform input values (list of Strings) to expected DL4J parameters (two Integer values): | |
String[] valuesAsArray = value.split(","); | |
INDArray input = Nd4j.create(Integer.parseInt(valuesAsArray[0]), Integer.parseInt(valuesAsArray[1])); | |
// Model inference in real time: | |
output = model.output(input); | |
prediction = output.toString(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment