THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
List<float> doSinglePrediction(){ MXNetInferenceModel model = new MXNetInferenceModel(); model.load("/local/path/to/model"); Rewriting List<float> singlePrediction = Arrays.asList(3.14159, .5772, 2.71828); model.predict(singlePrediction); return model.getPredictions().get(0); } List<List<float>> doBatchPrediction(){ MXNetInferenceModel model = new MXNetInferenceModel(); model.load("/local/path/to/model"); List<List<float>> batchPrediction = Arrays.asList( Arrays.asList(3.14159, .5772, 2.71828), Arrays.asList(.5772, 2.71828, 3.14159), Arrays.asList(2.71828, 3.14159, .5772)); model.predict(batchPrediction); return model.getPredictions(); }the example. Will add on Monday |
Open Questions
How to deal with Option[T] field in Java when calling from Scala?
...