com.intel.analytics.zoo.pipeline.api.keras.layers

Scale

class Scale[T] extends KerasLayer[Tensor[T], Tensor[T], T] with IdentityOutputShape

Scale is the combination of CMul and CAdd.

Computes the element-wise product of the input and weight, with the shape of the weight "expand" to match the shape of the input. Similarly, perform an expanded bias and perform an element-wise add.

When you use this layer as the first layer of a model, you need to provide the argument inputShape (a Single Shape, does not include the batch dimension).

Remark: This layer is from Torch and wrapped in Keras style.

T

The numeric type of parameter(e.g. weight, bias). Only support float/double now.

Linear Supertypes
IdentityOutputShape, KerasLayer[Tensor[T], Tensor[T], T], Container[Tensor[T], Tensor[T], T], AbstractModule[Tensor[T], Tensor[T], T], InferShape, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Scale
  2. IdentityOutputShape
  3. KerasLayer
  4. Container
  5. AbstractModule
  6. InferShape
  7. Serializable
  8. Serializable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Scale(size: Array[Int], inputShape: Shape = null)(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

    size

    Size of the weight and bias.

    inputShape

    A Single Shape, does not include the batch dimension.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def accGradParameters(input: Tensor[T], gradOutput: Tensor[T]): Unit

    Definition Classes
    KerasLayer → AbstractModule
  7. def apply(name: String): Option[AbstractModule[Activity, Activity, T]]

    Definition Classes
    Container → AbstractModule
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def backward(input: Tensor[T], gradOutput: Tensor[T]): Tensor[T]

    Definition Classes
    AbstractModule
  10. var backwardTime: Long

    Attributes
    protected
    Definition Classes
    AbstractModule
  11. def build(calcInputShape: Shape): Shape

    Definition Classes
    KerasLayer → InferShape
  12. def canEqual(other: Any): Boolean

    Definition Classes
    Container → AbstractModule
  13. final def checkEngineType(): Scale.this.type

    Definition Classes
    Container → AbstractModule
  14. def clearState(): Scale.this.type

    Definition Classes
    Container → AbstractModule
  15. final def clone(deepCopy: Boolean): AbstractModule[Tensor[T], Tensor[T], T]

    Definition Classes
    AbstractModule
  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def cloneModule(): AbstractModule[Tensor[T], Tensor[T], T]

    Definition Classes
    AbstractModule
  18. def computeOutputShape(inputShape: Shape): Shape

    Definition Classes
    IdentityOutputShape → InferShape
  19. def doBuild(inputShape: Shape): AbstractModule[Tensor[T], Tensor[T], T]

    Definition Classes
    Scale → KerasLayer
  20. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. def equals(other: Any): Boolean

    Definition Classes
    Container → AbstractModule → AnyRef → Any
  22. final def evaluate(): Scale.this.type

    Definition Classes
    Container → AbstractModule
  23. final def evaluate(dataSet: LocalDataSet[MiniBatch[T]], vMethods: Array[_ <: ValidationMethod[T]]): Array[(ValidationResult, ValidationMethod[T])]

    Definition Classes
    AbstractModule
  24. final def evaluate(dataset: RDD[Sample[T]], vMethods: Array[_ <: ValidationMethod[T]], batchSize: Option[Int]): Array[(ValidationResult, ValidationMethod[T])]

    Definition Classes
    AbstractModule
  25. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def findModules(moduleType: String): ArrayBuffer[AbstractModule[_, _, T]]

    Definition Classes
    Container
  27. final def forward(input: Tensor[T]): Tensor[T]

    Definition Classes
    AbstractModule
  28. var forwardTime: Long

    Attributes
    protected
    Definition Classes
    AbstractModule
  29. def freeze(names: String*): Scale.this.type

    Definition Classes
    Container → AbstractModule
  30. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  31. def getExtraParameter(): Array[Tensor[T]]

    Definition Classes
    Container → AbstractModule
  32. final def getInputShape(): Shape

    Definition Classes
    InferShape
  33. final def getName(): String

    Definition Classes
    AbstractModule
  34. final def getNumericType(): TensorDataType

    Definition Classes
    AbstractModule
  35. final def getOutputShape(): Shape

    Definition Classes
    InferShape
  36. def getParametersTable(): Table

    Definition Classes
    Container → AbstractModule
  37. final def getPrintName(): String

    Attributes
    protected
    Definition Classes
    AbstractModule
  38. final def getScaleB(): Double

    Definition Classes
    AbstractModule
  39. final def getScaleW(): Double

    Definition Classes
    AbstractModule
  40. def getTimes(): Array[(AbstractModule[_ <: Activity, _ <: Activity, T], Long, Long)]

    Definition Classes
    Container → AbstractModule
  41. final def getWeightsBias(): Array[Tensor[T]]

    Definition Classes
    AbstractModule
  42. var gradInput: Tensor[T]

    Definition Classes
    AbstractModule
  43. final def hasName: Boolean

    Definition Classes
    AbstractModule
  44. def hashCode(): Int

    Definition Classes
    Container → AbstractModule → AnyRef → Any
  45. val inputShape: Shape

    A Single Shape, does not include the batch dimension.

  46. def inputs(first: (ModuleNode[T], Int), nodesWithIndex: (ModuleNode[T], Int)*): ModuleNode[T]

    Definition Classes
    KerasLayer → AbstractModule
  47. def inputs(nodes: Array[ModuleNode[T]]): ModuleNode[T]

    Definition Classes
    KerasLayer → AbstractModule
  48. def inputs(nodes: ModuleNode[T]*): ModuleNode[T]

    Definition Classes
    KerasLayer → AbstractModule
  49. def isBuilt(): Boolean

    Definition Classes
    KerasLayer → InferShape
  50. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  51. def isKerasStyle(): Boolean

    Definition Classes
    KerasLayer → InferShape
  52. final def isTraining(): Boolean

    Definition Classes
    AbstractModule
  53. def labor: AbstractModule[Tensor[T], Tensor[T], T]

    Definition Classes
    KerasLayer
  54. def labor_=(value: AbstractModule[Tensor[T], Tensor[T], T]): Unit

    Definition Classes
    KerasLayer
  55. var line: String

    Attributes
    protected
    Definition Classes
    AbstractModule
  56. final def loadModelWeights(srcModel: Module[Float], matchAll: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
  57. final def loadWeights(weightPath: String, matchAll: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
  58. val modules: ArrayBuffer[AbstractModule[Activity, Activity, T]]

    Definition Classes
    Container
  59. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  60. final def notify(): Unit

    Definition Classes
    AnyRef
  61. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  62. var output: Tensor[T]

    Definition Classes
    AbstractModule
  63. def parameters(): (Array[Tensor[T]], Array[Tensor[T]])

    Definition Classes
    Container → AbstractModule
  64. final def predict(dataset: RDD[Sample[T]], batchSize: Int, shareBuffer: Boolean): RDD[Activity]

    Definition Classes
    AbstractModule
  65. final def predictClass(dataset: RDD[Sample[T]], batchSize: Int): RDD[Int]

    Definition Classes
    AbstractModule
  66. final def predictImage(imageFrame: ImageFrame, outputLayer: String, shareBuffer: Boolean, batchPerPartition: Int, predictKey: String, featurePaddingParam: Option[PaddingParam[T]]): ImageFrame

    Definition Classes
    AbstractModule
  67. def processInputs(first: (ModuleNode[T], Int), nodesWithIndex: (ModuleNode[T], Int)*): ModuleNode[T]

    Attributes
    protected
    Definition Classes
    AbstractModule
  68. def processInputs(nodes: Seq[ModuleNode[T]]): ModuleNode[T]

    Attributes
    protected
    Definition Classes
    AbstractModule
  69. final def quantize(): Module[T]

    Definition Classes
    AbstractModule
  70. def reset(): Unit

    Definition Classes
    Container → AbstractModule
  71. def resetTimes(): Unit

    Definition Classes
    Container → AbstractModule
  72. final def saveCaffe(prototxtPath: String, modelPath: String, useV2: Boolean, overwrite: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
  73. final def saveDefinition(path: String, overWrite: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
  74. final def saveModule(path: String, weightPath: String, overWrite: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
  75. final def saveTF(inputs: Seq[(String, Seq[Int])], path: String, byteOrder: ByteOrder, dataFormat: TensorflowDataFormat): Scale.this.type

    Definition Classes
    AbstractModule
  76. final def saveTorch(path: String, overWrite: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
  77. final def saveWeights(path: String, overWrite: Boolean): Unit

    Definition Classes
    AbstractModule
  78. var scaleB: Double

    Attributes
    protected
    Definition Classes
    AbstractModule
  79. var scaleW: Double

    Attributes
    protected
    Definition Classes
    AbstractModule
  80. final def setExtraParameter(extraParam: Array[Tensor[T]]): Scale.this.type

    Definition Classes
    AbstractModule
  81. final def setLine(line: String): Scale.this.type

    Definition Classes
    AbstractModule
  82. final def setName(name: String): Scale.this.type

    Definition Classes
    AbstractModule
  83. def setScaleB(b: Double): Scale.this.type

    Definition Classes
    Container → AbstractModule
  84. def setScaleW(w: Double): Scale.this.type

    Definition Classes
    Container → AbstractModule
  85. final def setWeightsBias(newWeights: Array[Tensor[T]]): Scale.this.type

    Definition Classes
    AbstractModule
  86. val size: Array[Int]

    Size of the weight and bias.

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

    Definition Classes
    AnyRef
  88. def toGraph(startNodes: ModuleNode[T]*): Graph[T]

    Definition Classes
    AbstractModule
  89. def toString(): String

    Definition Classes
    AbstractModule → AnyRef → Any
  90. var train: Boolean

    Attributes
    protected
    Definition Classes
    AbstractModule
  91. final def training(): Scale.this.type

    Definition Classes
    Container → AbstractModule
  92. def unFreeze(names: String*): Scale.this.type

    Definition Classes
    Container → AbstractModule
  93. def updateGradInput(input: Tensor[T], gradOutput: Tensor[T]): Tensor[T]

    Definition Classes
    KerasLayer → AbstractModule
  94. def updateOutput(input: Tensor[T]): Tensor[T]

    Definition Classes
    KerasLayer → AbstractModule
  95. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  98. final def zeroGradParameters(): Unit

    Definition Classes
    AbstractModule

Deprecated Value Members

  1. final def save(path: String, overWrite: Boolean): Scale.this.type

    Definition Classes
    AbstractModule
    Annotations
    @deprecated
    Deprecated

    (Since version 0.3.0) please use recommended saveModule(path, overWrite)

Inherited from IdentityOutputShape

Inherited from KerasLayer[Tensor[T], Tensor[T], T]

Inherited from Container[Tensor[T], Tensor[T], T]

Inherited from AbstractModule[Tensor[T], Tensor[T], T]

Inherited from InferShape

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped