Class

toolkit.neuralnetwork.function

MaxPooling

Related Doc: package function

Permalink

case class MaxPooling(input: DifferentiableField, poolSize: Int = 2, stride: Int = 2) extends DifferentiableField with Product with Serializable

The max pooling function with a poolSize x poolSize input field stepped by stride. The input must be two dimensional.

The ability to accomodate overlapping pools (where poolSize != stride) adds considerable complexity. In particular, the jacobianAdjoint must be prepared to sum multiple gradients (dY's) because of the potential spraying of values in the forward direction. Thus, there are two different implementation strategies taken for the two cases:

Overlapped pools: The jacobianAdjoint GPUOperator allocates one thread per element of the larger 'dX' field that it generates to more naturally handle the summing that might occur into each such element. For performance, the jacobianAdjoint GPUOperator assumes and reads in a gradient-sized "index field" that contains the field offset of the input that is the maximum of the pool. The forward operator leverages the existence of the "index field" to generate its output as well.

Non-overlapping pools: The jacobianAdjoint GPUOperator allocates one thread per element of the gradient 'dY' field and has that thread write the dY value to the appropriate 'dX' field element (no summing required). Since no "index field" is needed to help speed the jacobianAdjoint, the forward operator examines its input tile and outputs the maximum in a straightforward manner.

The current approach might run faster by using local memory, but at the risk of not being able to accommodate large strides..

input

input signal

poolSize

the edge size of the square pooling window, defaults to 2

stride

the amount by which the pooling window is stepped (in both x and y), defaults to 2

Linear Supertypes
Serializable, Serializable, Product, Equals, DifferentiableField, GradientPropagation, DifferentiableFieldOps, BasicOps, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MaxPooling
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. DifferentiableField
  7. GradientPropagation
  8. DifferentiableFieldOps
  9. BasicOps
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MaxPooling(input: DifferentiableField, poolSize: Int = 2, stride: Int = 2)

    Permalink

    input

    input signal

    poolSize

    the edge size of the square pooling window, defaults to 2

    stride

    the amount by which the pooling window is stepped (in both x and y), defaults to 2

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def *(that: Float): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  4. def *(that: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  5. def +(that: Float): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  6. def +(that: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  7. def -(that: Float): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  8. def -(that: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  9. def /(that: Float): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  10. def /(that: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    DifferentiableFieldOps
  11. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def activateSGD(initField: libcog.Field = ScalarField(1f), invokeCallbacks: Boolean = true): Unit

    Permalink
    Definition Classes
    GradientPropagation
  13. def add(input: DifferentiableField, c: Float): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  14. def add(left: DifferentiableField, right: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  15. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  16. var backward: Option[libcog.Field]

    Permalink
    Definition Classes
    DifferentiableField
  17. def backwardCallback(back: libcog.Field): Unit

    Permalink
    Definition Classes
    DifferentiableField
  18. val batchSize: Int

    Permalink
    Definition Classes
    MaxPoolingDifferentiableField
  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def divide(input: DifferentiableField, c: Float): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  21. def divide(left: DifferentiableField, right: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  22. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. val forward: libcog.Field

    Permalink
    Definition Classes
    MaxPoolingDifferentiableField
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. var gradientBinding: Option[GradientBinding]

    Permalink
    Definition Classes
    DifferentiableField
  27. val gradientConsumer: Boolean

    Permalink
    Definition Classes
    DifferentiableField
  28. val input: DifferentiableField

    Permalink

    input signal

  29. val inputs: Map[Symbol, GradientPort]

    Permalink
    Definition Classes
    MaxPoolingDifferentiableField
  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. def multiply(input: DifferentiableField, c: Float): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  32. def multiply(left: DifferentiableField, right: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  33. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  36. val poolSize: Int

    Permalink

    the edge size of the square pooling window, defaults to 2

  37. def pow(input: DifferentiableField, n: Float): DifferentiableField

    Permalink

    Raise a node to a fixed power.

    Raise a node to a fixed power. Cog has two pow() function signatures corresponding to both integer and non-integer powers. The integer case is detected here and special-cased (instead of having a separate PowN node for this).

    If the power n is anything other than a positive integer, make sure the inputs are always positive or NaNs will result.

    input

    the input signal

    n

    the power to raise the input to

    Definition Classes
    BasicOps
  38. val stride: Int

    Permalink

    the amount by which the pooling window is stepped (in both x and y), defaults to 2

  39. def subtract(input: DifferentiableField, c: Float): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  40. def subtract(left: DifferentiableField, right: DifferentiableField): DifferentiableField

    Permalink
    Definition Classes
    BasicOps
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def totalDerivative(): libcog.Field

    Permalink
    Definition Classes
    GradientPropagation
  43. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from DifferentiableField

Inherited from GradientPropagation

Inherited from DifferentiableFieldOps

Inherited from BasicOps

Inherited from AnyRef

Inherited from Any

Ungrouped