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

Model

class Model[T] extends KerasNet[T] with NetUtils[T, Model[T]]

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

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: Activity, gradOutput: Activity): 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: Activity, gradOutput: Activity): Activity

    Definition Classes
    AbstractModule
  10. var backwardTime: Long

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

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

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

    Definition Classes
    Container → AbstractModule
  14. def clearGradientClipping(): Unit

    Clear gradient clipping parameters.

    Clear gradient clipping parameters. In this case, gradient clipping will not be applied. In order to take effect, it needs to be called before fit.

    Definition Classes
    KerasNet
  15. def clearState(): Model.this.type

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

    Definition Classes
    AbstractModule
  17. def clone(): AnyRef

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

    Definition Classes
    AbstractModule
  19. def compile(optimizer: OptimMethod[T], loss: (Variable[T], Variable[T]) ⇒ Variable[T])(implicit ev: TensorNumeric[T]): Unit

    Definition Classes
    KerasNet
  20. def compile(optimizer: OptimMethod[T], loss: (Variable[T], Variable[T]) ⇒ Variable[T], metrics: List[ValidationMethod[T]])(implicit ev: TensorNumeric[T]): Unit

    Definition Classes
    KerasNet
  21. def compile(optimizer: String, loss: String)(implicit ev: TensorNumeric[T]): Unit

    Definition Classes
    KerasNet
  22. def compile(optimizer: String, loss: String, metrics: List[String])(implicit ev: TensorNumeric[T]): Unit

    Alternatively, one can pass in the corresponding Keras-Style string representations when calling compile.

    Alternatively, one can pass in the corresponding Keras-Style string representations when calling compile.

    For example: optimizer = "sgd", loss = "mse", metrics = List("accuracy")

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

    Configure the learning process.

    Configure the learning process. It MUST be called before fit or evaluate.

    optimizer

    Optimization method to be used.

    loss

    Criterion to be used.

    metrics

    Validation method(s) to be used. Default is null if no validation is needed.

    Definition Classes
    KerasNet
  24. def computeOutputShape(inputShape: Shape): Shape

    Definition Classes
    Model → KerasLayer → InferShape
  25. def doBuild(inputShape: Shape): StaticGraph[T]

    Definition Classes
    Model → KerasLayer
  26. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    Container → AbstractModule → AnyRef → Any
  28. def evaluate(x: LocalDataSet[MiniBatch[T]])(implicit ev: TensorNumeric[T]): Array[(ValidationResult, ValidationMethod[T])]

    Evaluate a model in local mode.

    Evaluate a model in local mode.

    x

    Evaluation dataset, LocalDataSet.

    Definition Classes
    KerasNet
  29. def evaluate(x: RDD[Sample[T]], batchSize: Int)(implicit ev: TensorNumeric[T]): Array[(ValidationResult, ValidationMethod[T])]

    Evaluate a model on a given dataset.

    Evaluate a model on a given dataset.

    x

    Evaluation dataset, RDD of Sample.

    batchSize

    Number of samples per batch.

    Definition Classes
    KerasNet
  30. final def evaluate(): Model.this.type

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

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

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

    Definition Classes
    AbstractModule
  34. def finalize(): Unit

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

    Definition Classes
    Container
  36. def fit(x: ImageSet, batchSize: Int, nbEpoch: Int)(implicit ev: TensorNumeric[T]): Unit

    Definition Classes
    KerasNet
  37. def fit(x: ImageSet, batchSize: Int, nbEpoch: Int, validationData: ImageSet)(implicit ev: TensorNumeric[T]): Unit

    Definition Classes
    KerasNet
  38. def fit(x: RDD[Sample[T]], batchSize: Int = 32, nbEpoch: Int = 10, validationData: RDD[Sample[T]] = null)(implicit ev: TensorNumeric[T]): Unit

    Train a model for a fixed number of epochs on a dataset.

    Train a model for a fixed number of epochs on a dataset.

    x

    Training dataset, RDD of Sample.

    batchSize

    Number of samples per gradient update. Default is 32.

    nbEpoch

    Number of iterations to train. Default is 10.

    validationData

    RDD of Sample, or null if validation is not configured. Default is null.

    Definition Classes
    KerasNet
  39. def fit[D](x: DataSet[D], nbEpoch: Int)(implicit arg0: ClassTag[D], ev: TensorNumeric[T]): Unit

    Definition Classes
    KerasNet
  40. def fit[D](x: DataSet[D], nbEpoch: Int, validationData: DataSet[MiniBatch[T]])(implicit arg0: ClassTag[D], ev: TensorNumeric[T]): Unit

    Train a model for a fixed number of epochs on a dataset.

    Train a model for a fixed number of epochs on a dataset.

    x

    Training dataset. If x is an instance of LocalDataSet, train in local mode.

    nbEpoch

    Number of iterations to train.

    validationData

    Dataset for validation, or null if validation is not configured.

    Definition Classes
    KerasNet
  41. final def forward(input: Activity): Activity

    Definition Classes
    AbstractModule
  42. var forwardTime: Long

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

    Definition Classes
    Container → AbstractModule
  44. def freezeUpTo(names: String*): Model.this.type

    Freeze the model from the bottom up to the layers specified by names (inclusive).

    Freeze the model from the bottom up to the layers specified by names (inclusive).

    This is useful for finetune a model

    Definition Classes
    NetUtils
  45. def from[T](vars: Variable[T]*)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Variable[T]

    Build graph: some other modules point to current module

    Build graph: some other modules point to current module

    vars

    upstream variables

    returns

    Variable containing current module

    Definition Classes
    Net
  46. final def getClass(): Class[_]

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

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

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

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

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

    Definition Classes
    InferShape
  52. def getParametersTable(): Table

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

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

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

    Definition Classes
    AbstractModule
  56. def getSubModules(): List[AbstractModule[Activity, Activity, T]]

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

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

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

    Definition Classes
    AbstractModule
  60. var gradInput: Activity

    Definition Classes
    AbstractModule
  61. final def hasName: Boolean

    Definition Classes
    AbstractModule
  62. def hashCode(): Int

    Definition Classes
    Container → AbstractModule → AnyRef → Any
  63. def inputs(first: (ModuleNode[T], Int), nodesWithIndex: (ModuleNode[T], Int)*): ModuleNode[T]

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

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

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

    Definition Classes
    KerasLayer → InferShape
  67. def isFrozen[T]()(implicit arg0: ClassTag[T]): Boolean

    Definition Classes
    Net
  68. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  69. def isKerasStyle(): Boolean

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

    Definition Classes
    AbstractModule
  71. def labor: AbstractModule[Activity, Activity, T]

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

    Definition Classes
    KerasLayer
  73. var line: String

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

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

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

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

    Definition Classes
    AnyRef
  78. def newGraph(outputs: Seq[String]): Model[T]

    Specify a seq of nodes as output and return a new graph using the existing nodes

    Specify a seq of nodes as output and return a new graph using the existing nodes

    Definition Classes
    ModelNetUtils
  79. def newGraph(output: String): Model[T]

    Specify a node as output and return a new graph using the existing nodes

    Specify a node as output and return a new graph using the existing nodes

    Definition Classes
    ModelNetUtils
  80. def node(name: String): ModuleNode[T]

    Return the node in the graph as specified by the name

    Return the node in the graph as specified by the name

    Definition Classes
    ModelNetUtils
  81. def nodes(names: Seq[String]): Seq[ModuleNode[T]]

    Return the nodes in the graph as specified by the names

    Return the nodes in the graph as specified by the names

    Definition Classes
    ModelNetUtils
  82. final def notify(): Unit

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

    Definition Classes
    AnyRef
  84. var output: Activity

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

    Definition Classes
    Container → AbstractModule
  86. def predict(x: LocalDataSet[MiniBatch[T]], batchSize: Int)(implicit ev: TensorNumeric[T]): Array[Activity]

    Use a model to do prediction in local mode.

    Use a model to do prediction in local mode.

    x

    Prediction data, LocalDataSet.

    Definition Classes
    KerasNet
  87. def predict(x: RDD[Sample[T]], batchSize: Int)(implicit ev: TensorNumeric[T]): RDD[Activity]

    Use a model to do prediction.

    Use a model to do prediction.

    x

    Prediction data, RDD of Sample.

    batchSize

    Number of samples per batch.

    Definition Classes
    KerasNet
  88. final def predict(dataset: RDD[Sample[T]], batchSize: Int, shareBuffer: Boolean): RDD[Activity]

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

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

    Use a model to predict for classes.

    Use a model to 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
    KerasNet
  91. final def predictImage(imageFrame: ImageFrame, outputLayer: String, shareBuffer: Boolean, batchPerPartition: Int, predictKey: String, featurePaddingParam: Option[PaddingParam[T]]): ImageFrame

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

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

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

    Definition Classes
    AbstractModule
  95. def release(): Unit

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

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

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

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

    Definition Classes
    AbstractModule
  100. def saveGraphTopology(logPath: String, backward: Boolean = false): Model.this.type

    Save the current model graph to a folder, which can be displayed in TensorBoard by running the command: tensorboard --logdir logPath

    Save the current model graph to a folder, which can be displayed in TensorBoard by running the command: tensorboard --logdir logPath

    logPath

    The path to save the model graph.

    backward

    Whether to draw backward graph instead of forward.

    returns

  101. final def saveModule(path: String, weightPath: String, overWrite: Boolean): Model.this.type

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

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

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

    Definition Classes
    AbstractModule
  105. var scaleB: Double

    Attributes
    protected
    Definition Classes
    AbstractModule
  106. var scaleW: Double

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

    Configure checkpoint settings to write snapshots every epoch during the training process.

    Configure checkpoint settings to write snapshots every epoch during the training process. In order to take effect, it needs to be called before fit.

    path

    The path to save snapshots. Make sure this path exists beforehand.

    overWrite

    Whether to overwrite existing snapshots in the given path. Default is true.

    Definition Classes
    KerasNet
  108. def setConstantGradientClipping(min: Float, max: Float): Unit

    Set constant gradient clipping during the training process.

    Set constant gradient clipping during the training process. In order to take effect, it needs to be called before fit.

    min

    The minimum value to clip by. Double.

    max

    The maximum value to clip by. Double.

    Definition Classes
    KerasNet
  109. final def setExtraParameter(extraParam: Array[Tensor[T]]): Model.this.type

    Definition Classes
    AbstractModule
  110. def setGradientClippingByL2Norm(clipNorm: Float): Unit

    Clip gradient to a maximum L2-Norm during the training process.

    Clip gradient to a maximum L2-Norm during the training process. In order to take effect, it needs to be called before fit.

    clipNorm

    Gradient L2-Norm threshold. Double.

    Definition Classes
    KerasNet
  111. final def setLine(line: String): Model.this.type

    Definition Classes
    AbstractModule
  112. final def setName(name: String): Model.this.type

    Definition Classes
    AbstractModule
  113. def setScaleB(b: Double): Model.this.type

    Definition Classes
    Container → AbstractModule
  114. def setScaleW(w: Double): Model.this.type

    Definition Classes
    Container → AbstractModule
  115. def setTensorBoard(logDir: String, appName: String): Unit

    Set summary information during the training process for visualization purposes.

    Set summary information during the training process for visualization purposes. Saved summary can be viewed via TensorBoard. In order to take effect, it needs to be called before fit.

    Training summary will be saved to 'logDir/appName/train' and validation summary (if any) will be saved to 'logDir/appName/validation'.

    logDir

    The base directory path to store training and validation logs.

    appName

    The name of the application.

    Definition Classes
    KerasNet
  116. final def setWeightsBias(newWeights: Array[Tensor[T]]): Model.this.type

    Definition Classes
    AbstractModule
  117. def summary(lineLength: Int = 120, positions: Array[Double] = Array(.33, .55, .67, 1)): Unit

    Print out the summary information of an Analytics Zoo Keras Model.

    Print out the summary information of an Analytics Zoo Keras Model.

    For each layer in the model, there will be a separate row containing four columns: Layer (type) Output Shape Param # Connected to

    In addition, total number of parameters of this model, separated into trainable and non-trainable counts, will be printed out after the table.

    lineLength

    The total length of one row. Default is 120.

    positions

    The maximum absolute length proportion(%) of each field. Array of Double of length 4. Usually you don't need to adjust this parameter. Default is Array(.33, .55, .67, 1), meaning that the first field will occupy up to 33% of lineLength, the second field will occupy up to (55-33)% of lineLength, the third field will occupy up to (67-55)% of lineLength, the fourth field will occupy the remaining line (100-67)%. If the field has a larger length, the remaining part will be trimmed. If the field has a smaller length, the remaining part will be white spaces.

    Definition Classes
    ModelKerasNet
  118. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Definition Classes
    AbstractModule
  120. def toKeras(): Model[T]

    Definition Classes
    ModelNetUtils
  121. def toModel(): Model[T]

    Definition Classes
    ModelKerasNet
  122. def toString(): String

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

    Attributes
    protected
    Definition Classes
    AbstractModule
  124. final def training(): Model.this.type

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

    Definition Classes
    Model → Container → AbstractModule
  126. def updateGradInput(input: Activity, gradOutput: Activity): Activity

    Definition Classes
    KerasLayer → AbstractModule
  127. def updateOutput(input: Activity): Activity

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

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

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

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

    Definition Classes
    AbstractModule

Deprecated Value Members

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

    Definition Classes
    AbstractModule
    Annotations
    @deprecated
    Deprecated

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

Inherited from NetUtils[T, Model[T]]

Inherited from KerasNet[T]

Inherited from Net

Inherited from KerasLayer[Activity, Activity, T]

Inherited from Container[Activity, Activity, T]

Inherited from AbstractModule[Activity, Activity, T]

Inherited from InferShape

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped