Class/Object

com.intel.analytics.zoo.models.seq2seq

Seq2seq

Related Docs: object Seq2seq | package seq2seq

Permalink

class Seq2seq[T] extends ZooModel[Table, Tensor[T], T]

Seq2seq A trainable interface for a simple, generic encoder + decoder model

Linear Supertypes
ZooModel[Table, Tensor[T], T], Container[Table, Tensor[T], T], AbstractModule[Table, Tensor[T], T], InferShape, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Seq2seq
  2. ZooModel
  3. Container
  4. AbstractModule
  5. InferShape
  6. Serializable
  7. Serializable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Seq2seq(encoder: Encoder[T], decoder: Decoder[T], inputShape: Shape, outputShape: Shape, bridge: KerasLayer[Activity, Activity, T], generator: KerasLayer[Activity, Activity, T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

    Permalink

    encoder

    an encoder object

    decoder

    a decoder object

    inputShape

    shape of encoder input, for variable length, please input -1

    outputShape

    shape of decoder input, for variable length, please input -1

    bridge

    connect encoder and decoder

    generator

    Feeding decoder output to generator to generate final result

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. def accGradParameters(input: Table, gradOutput: Tensor[T]): Unit

    Permalink
    Definition Classes
    ZooModel → AbstractModule
  5. def addModel(model: AbstractModule[Table, Tensor[T], T]): Seq2seq.this.type

    Permalink
    Definition Classes
    ZooModel
  6. def apply(name: String): Option[AbstractModule[Activity, Activity, T]]

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

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

    Permalink
    Definition Classes
    AbstractModule
  9. var backwardTime: Long

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractModule
  10. val bridge: KerasLayer[Activity, Activity, T]

    Permalink

    connect encoder and decoder

  11. def build(): Seq2seq.this.type

    Permalink
    Definition Classes
    ZooModel
  12. def buildModel(): AbstractModule[Table, Tensor[T], T]

    Permalink

    Override this method to define a model.

    Override this method to define a model.

    Definition Classes
    Seq2seqZooModel
  13. def canEqual(other: Any): Boolean

    Permalink
    Definition Classes
    Container → AbstractModule
  14. final def checkEngineType(): Seq2seq.this.type

    Permalink
    Definition Classes
    Container → AbstractModule
  15. def clearState(): Seq2seq.this.type

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

    Permalink
    Definition Classes
    AbstractModule
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def cloneModule(): Seq2seq.this.type

    Permalink
    Definition Classes
    AbstractModule
  19. def compile(optimizer: OptimMethod[T], loss: Criterion[T], metrics: List[ValidationMethod[T]] = null)(implicit ev: TensorNumeric[T]): Unit

    Permalink
  20. val decoder: Decoder[T]

    Permalink

    a decoder object

  21. val encoder: Encoder[T]

    Permalink

    an encoder object

  22. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    Container → AbstractModule → AnyRef → Any
  24. final def evaluate(): Seq2seq.this.type

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

    Permalink
    Definition Classes
    AbstractModule
  26. final def evaluate(dataset: RDD[MiniBatch[T]], vMethods: Array[_ <: ValidationMethod[T]]): Array[(ValidationResult, ValidationMethod[T])]

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

    Permalink
    Definition Classes
    AbstractModule
  28. final def evaluateImage(imageFrame: ImageFrame, vMethods: Array[_ <: ValidationMethod[T]], batchSize: Option[Int]): Array[(ValidationResult, ValidationMethod[T])]

    Permalink
    Definition Classes
    AbstractModule
  29. def finalize(): Unit

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

    Permalink
    Definition Classes
    Container
  31. def fit(x: RDD[Sample[T]], batchSize: Int = 32, nbEpoch: Int = 10, validationData: RDD[Sample[T]] = null, featurePaddingParam: PaddingParam[T] = null, labelPaddingParam: PaddingParam[T] = null)(implicit ev: TensorNumeric[T]): Unit

    Permalink
  32. final def forward(input: Table): Tensor[T]

    Permalink
    Definition Classes
    AbstractModule
  33. var forwardTime: Long

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractModule
  34. def freeze(names: String*): Seq2seq.this.type

    Permalink
    Definition Classes
    Container → AbstractModule
  35. val generator: KerasLayer[Activity, Activity, T]

    Permalink

    Feeding decoder output to generator to generate final result

  36. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    InferShape
  39. final def getName(): String

    Permalink
    Definition Classes
    AbstractModule
  40. final def getNumericType(): TensorDataType

    Permalink
    Definition Classes
    AbstractModule
  41. final def getOutputShape(): Shape

    Permalink
    Definition Classes
    InferShape
  42. def getParametersTable(): Table

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

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

    Permalink
    Definition Classes
    AbstractModule
  45. final def getScaleW(): Double

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

    Permalink
    Definition Classes
    Container → AbstractModule
  47. final def getTimesGroupByModuleType(): Array[(String, Long, Long)]

    Permalink
    Definition Classes
    AbstractModule
  48. final def getWeightsBias(): Array[Tensor[T]]

    Permalink
    Definition Classes
    AbstractModule
  49. var gradInput: Table

    Permalink
    Definition Classes
    AbstractModule
  50. final def hasName: Boolean

    Permalink
    Definition Classes
    AbstractModule
  51. def hashCode(): Int

    Permalink
    Definition Classes
    Container → AbstractModule → AnyRef → Any
  52. def infer(input: Tensor[T], startSign: Tensor[T], maxSeqLen: Int = 30, stopSign: Tensor[T] = null, buildOutput: KerasLayer[Tensor[T], Tensor[T], T] = null): Tensor[T]

    Permalink

    Infer output with given input

    Infer output with given input

    input

    a sequence of data feed into encoder, eg: batch x seqLen x featureSize

    startSign

    a tensor which represents start and is fed into decoder

    maxSeqLen

    max sequence length for final output

    stopSign

    a tensor that indicates model should stop infer further if current output is the same with stopSign

    buildOutput

    Feeding model output to buildOutput to generate final result

  53. val inputShape: Shape

    Permalink

    shape of encoder input, for variable length, please input -1

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

    Permalink
    Definition Classes
    AbstractModule
  55. def inputs(nodes: Array[ModuleNode[T]]): ModuleNode[T]

    Permalink
    Definition Classes
    AbstractModule
  56. def inputs(nodes: ModuleNode[T]*): ModuleNode[T]

    Permalink
    Definition Classes
    AbstractModule
  57. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  58. final def isTraining(): Boolean

    Permalink
    Definition Classes
    AbstractModule
  59. var line: String

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

    Permalink
    Definition Classes
    AbstractModule
  61. final def loadWeights(weightPath: String, matchAll: Boolean): Seq2seq.this.type

    Permalink
    Definition Classes
    AbstractModule
  62. def model: AbstractModule[Table, Tensor[T], T]

    Permalink

    The defined model, either from buildModel() or loaded from file.

    The defined model, either from buildModel() or loaded from file.

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  67. var output: Tensor[T]

    Permalink
    Definition Classes
    AbstractModule
  68. val outputShape: Shape

    Permalink

    shape of decoder input, for variable length, please input -1

  69. def parameters(): (Array[Tensor[T]], Array[Tensor[T]])

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

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

    Permalink
    Definition Classes
    AbstractModule
  72. def predictClasses(x: RDD[Sample[T]], batchSize: Int = 1, zeroBasedLabel: Boolean = true): RDD[Int]

    Permalink

    Predict for classes.

    Predict for classes. By default, label predictions start from 0.

    x

    Prediction data, RDD of Sample.

    batchSize

    Number of samples per batch. Default is 32.

    zeroBasedLabel

    Boolean. Whether result labels start from 0. Default is true. If false, result labels start from 1.

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

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

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

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

    Permalink
    Definition Classes
    AbstractModule
  77. def release(): Unit

    Permalink
    Definition Classes
    Container → AbstractModule
  78. def reset(): Unit

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

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

    Permalink
    Definition Classes
    AbstractModule
  81. final def saveDefinition(path: String, overWrite: Boolean): Seq2seq.this.type

    Permalink
    Definition Classes
    AbstractModule
  82. def saveModel(path: String, weightPath: String = null, overWrite: Boolean = false): Seq2seq.this.type

    Permalink

    Save the model to the specified path.

    Save the model to the specified path.

    path

    The path to save the model. Local file system, HDFS and Amazon S3 are supported. HDFS path should be like "hdfs://[host]:[port]/xxx". Amazon S3 path should be like "s3a://bucket/xxx".

    weightPath

    The path to save weights. Default is null.

    overWrite

    Whether to overwrite the file if it already exists. Default is false.

    Definition Classes
    ZooModel
  83. final def saveModule(path: String, weightPath: String, overWrite: Boolean): Seq2seq.this.type

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

    Permalink
    Definition Classes
    AbstractModule
  85. final def saveTorch(path: String, overWrite: Boolean): Seq2seq.this.type

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

    Permalink
    Definition Classes
    AbstractModule
  87. var scaleB: Double

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractModule
  88. var scaleW: Double

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractModule
  89. def setCheckpoint(path: String, overWrite: Boolean = true): Unit

    Permalink
  90. def setEvaluateStatus(): Seq2seq.this.type

    Permalink

    Set the model to be in evaluate status, i.e.

    Set the model to be in evaluate status, i.e. remove the effect of Dropout, etc.

    Definition Classes
    ZooModel
  91. final def setExtraParameter(extraParam: Array[Tensor[T]]): Seq2seq.this.type

    Permalink
    Definition Classes
    AbstractModule
  92. final def setLine(line: String): Seq2seq.this.type

    Permalink
    Definition Classes
    AbstractModule
  93. final def setName(name: String): Seq2seq.this.type

    Permalink
    Definition Classes
    AbstractModule
  94. def setScaleB(b: Double): Seq2seq.this.type

    Permalink
    Definition Classes
    Container → AbstractModule
  95. def setScaleW(w: Double): Seq2seq.this.type

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

    Permalink
    Definition Classes
    AbstractModule
  97. def summary(): Unit

    Permalink

    Print out the summary of the model.

    Print out the summary of the model.

    Definition Classes
    ZooModel
  98. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AbstractModule
  100. def toString(): String

    Permalink
    Definition Classes
    AbstractModule → AnyRef → Any
  101. var train: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractModule
  102. final def training(): Seq2seq.this.type

    Permalink
    Definition Classes
    Container → AbstractModule
  103. def unFreeze(names: String*): Seq2seq.this.type

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

    Permalink
    Definition Classes
    ZooModel → AbstractModule
  105. def updateOutput(input: Table): Tensor[T]

    Permalink
    Definition Classes
    ZooModel → AbstractModule
  106. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  109. def zeroGradParameters(): Unit

    Permalink
    Definition Classes
    AbstractModule

Deprecated Value Members

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

    Permalink
    Definition Classes
    AbstractModule
    Annotations
    @deprecated
    Deprecated

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

Inherited from ZooModel[Table, Tensor[T], T]

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

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

Inherited from InferShape

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped