Class BatchInputParser


  • public class BatchInputParser
    extends java.lang.Object
    Parses a whole multi part upload buffer and converts it to an INDArray minibatch.

    Uses InputAdapter specified by name allowing conversion of each type of input file's raw content to an INDArray

    Author:
    Adam Gibson
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object convert​(io.vertx.core.buffer.Buffer input, java.lang.String name, ConverterArgs params, io.vertx.ext.web.RoutingContext routingContext)
      Use the converter specified by name to convert a raw Buffer to a proper input for inference
      org.datavec.api.records.Record[] createBatch​(io.vertx.ext.web.RoutingContext routingContext)
      Create a batch from the RoutingContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BatchInputParser

        public BatchInputParser()
    • Method Detail

      • createBatch

        public org.datavec.api.records.Record[] createBatch​(io.vertx.ext.web.RoutingContext routingContext)
                                                     throws java.io.IOException
        Create a batch from the RoutingContext
        Parameters:
        routingContext - the routing context to create the batch from
        Returns:
        the proper ndarray batch with the ndarrays merged with a batch per input
        Throws:
        java.io.IOException - I/O Exception
      • convert

        public java.lang.Object convert​(io.vertx.core.buffer.Buffer input,
                                        java.lang.String name,
                                        ConverterArgs params,
                                        io.vertx.ext.web.RoutingContext routingContext)
                                 throws java.io.IOException
        Use the converter specified by name to convert a raw Buffer to a proper input for inference
        Parameters:
        input - the raw content
        name - the name of the input converter to use
        params - the params to use where needed
        routingContext - RoutingContext
        Returns:
        converted INDArray
        Throws:
        java.io.IOException - I/O Exception