Class/Object

toolkit.neuralnetwork.source

ByteFileSensor

Related Docs: object ByteFileSensor | package source

Permalink

class ByteFileSensor extends AnyRef

A Cog Sensor that is used to read bytes from a file or jar and format them as a VectorField. Each byte is interpreted as an element of the VectorField 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 at resourcePath + path. Third, a resource in the classpath at path. The value of resourcePath will typically be "src/main/resources/". Note that fieldCount is mandatory when loading data from the classpath. When loading resources directly from the filesystem, the loader will ignore fieldCount 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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ByteFileSensor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ByteFileSensor(path: String, resourcePath: String, fieldShape: libcog.Shape, vectorLen: Int, fieldCount: Option[Long], batchSize: Int, updatePeriod: Int, headerLen: Int, pipelined: Boolean = true, offset: Int = 0, stride: Int = 1, resetState: Long = 0L)

    Permalink

    path

    The resource to load

    resourcePath

    The search prefix for resources

    fieldShape

    The Shape of the field

    vectorLen

    Number of elements in the Vector

    fieldCount

    An optional number of fields in the resource

    batchSize

    Number of examples to read per field

    updatePeriod

    Number of ticks to wait before updating the Field

    headerLen

    Number of bytes to drop from the beginning of the file

    offset

    Starting offset (in terms of batches) into the file

    stride

    Distance (in batchSize units) between the start of one batch and the start of the next

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def sensor: Field

    Permalink
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped