The resource to load
The search prefix for resources
The Shape
of the field
Number of elements in the Vector
An optional number of fields in the resource
Number of examples to read per field
Number of ticks to wait before updating the Field
Number of bytes to drop from the beginning of the file
Starting offset (in terms of batches) into the file
Distance (in batchSize units) between the start of one batch and the start of the next
A Cog
Sensor
that is used to read bytes from a file or jar and format them as aVectorField
. Each byte is interpreted as an element of theVectorField
and thus the elements of the resulting field are from 0f to 255f. An updatePeriod greater than one will keep the code constant for multiple Cog ticks and is generally used in cases where inference takes place over multiple ticks due to sampling. When the Sensor hits the end of the file it will reset to the beginning automatically.The loader will search for the desired resource in three places. First, a file on the filesystem at
path
. Second, a file on the filesystem atresourcePath + path
. Third, a resource in the classpath atpath
. The value ofresourcePath
will typically be "src/main/resources/". Note thatfieldCount
is mandatory when loading data from the classpath. When loading resources directly from the filesystem, the loader will ignorefieldCount
and use the actual length of the file.The offset and stride parameters are typically used when multiple graphs are cooperating to train on a single data set. In that case, these parameters can be set such that each graph trains on a different part of the input data set and doesn't duplicate the effort of other graphs. E.g., a stride of two skips every other batch in the input file, so a sensor with offset zero and stride two hits all the even-numbered batches in the file, and a second sensor with offset one and stride two hits all the odd- numbered batches.