A Cog Sensor
that is used to read bytes from a file or jar and format them as
a VectorField
.
Helper class to manage the parameters packed into the single Sensor save/restore parameter string.
Helper class to manage the parameters packed into the single Sensor save/restore parameter string.
Parameters are saved as comma-separated key=value parameter definitions. The advantage of using this class is that values that are null strings or contain spaces are OK. Values should not contain the "=" or "," character however.
The 1D Sensor that sits behind the GPUOperator reshaper in a ByteFileSensor.
The 1D Sensor that sits behind the GPUOperator reshaper in a ByteFileSensor. This sensor can be saved / restored.
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.