final case class TrainingInfoProto(initialization: Option[GraphProto] = _root_.scala.None, algorithm: Option[GraphProto] = _root_.scala.None, initializationBinding: Seq[StringStringEntryProto] = _root_.scala.Seq.empty, updateBinding: Seq[StringStringEntryProto] = _root_.scala.Seq.empty, unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty) extends GeneratedMessage with Updatable[TrainingInfoProto] with Product with Serializable

Training information TrainingInfoProto stores information for training a model. In particular, this defines two functionalities: an initialization-step and a training-algorithm-step. Initialization resets the model back to its original state as if no training has been performed. Training algorithm improves the model based on input data.

The semantics of the initialization-step is that the initializers in ModelProto.graph and in TrainingInfoProto.algorithm are first initialized as specified by the initializers in the graph, and then updated by the "initialization_binding" in every instance in ModelProto.training_info.

The field "algorithm" defines a computation graph which represents a training algorithm's step. After the execution of a TrainingInfoProto.algorithm, the initializers specified by "update_binding" may be immediately updated. If the targeted training algorithm contains consecutive update steps (such as block coordinate descent methods), the user needs to create a TrainingInfoProto for each step.

initialization

This field describes a graph to compute the initial tensors upon starting the training process. Initialization graph has no input and can have multiple outputs. Usually, trainable tensors in neural networks are randomly initialized. To achieve that, for each tensor, the user can put a random number operator such as RandomNormal or RandomUniform in TrainingInfoProto.initialization.node and assign its random output to the specific tensor using "initialization_binding". This graph can also set the initializers in "algorithm" in the same TrainingInfoProto; a use case is resetting the number of training iteration to zero. By default, this field is an empty graph and its evaluation does not produce any output. Thus, no initializer would be changed by default.

algorithm

This field represents a training algorithm step. Given required inputs, it computes outputs to update initializers in its own or inference graph's initializer lists. In general, this field contains loss node, gradient node, optimizer node, increment of iteration count. An execution of the training algorithm step is performed by executing the graph obtained by combining the inference graph (namely "ModelProto.graph") and the "algorithm" graph. That is, the actual the actual input/initializer/output/node/value_info/sparse_initializer list of the training graph is the concatenation of "ModelProto.graph.input/initializer/output/node/value_info/sparse_initializer" and "algorithm.input/initializer/output/node/value_info/sparse_initializer" in that order. This combined graph must satisfy the normal ONNX conditions. Now, let's provide a visualization of graph combination for clarity. Let the inference graph (i.e., "ModelProto.graph") be tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d and the "algorithm" graph be tensor_d -> Add -> tensor_e The combination process results tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d -> Add -> tensor_e Notice that an input of a node in the "algorithm" graph may reference the output of a node in the inference graph (but not the other way round). Also, inference node cannot reference inputs of "algorithm". With these restrictions, inference graph can always be run independently without training information. By default, this field is an empty graph and its evaluation does not produce any output. Evaluating the default training step never update any initializers.

initializationBinding

This field specifies the bindings from the outputs of "initialization" to some initializers in "ModelProto.graph.initializer" and the "algorithm.initializer" in the same TrainingInfoProto. See "update_binding" below for details. By default, this field is empty and no initializer would be changed by the execution of "initialization".

updateBinding

Gradient-based training is usually an iterative procedure. In one gradient descent iteration, we apply x = x - r * g where "x" is the optimized tensor, "r" stands for learning rate, and "g" is gradient of "x" with respect to a chosen loss. To avoid adding assignments into the training graph, we split the update equation into y = x - r * g x = y The user needs to save "y = x - r * g" into TrainingInfoProto.algorithm. To tell that "y" should be assigned to "x", the field "update_binding" may contain a key-value pair of strings, "x" (key of StringStringEntryProto) and "y" (value of StringStringEntryProto). For a neural network with multiple trainable (mutable) tensors, there can be multiple key-value pairs in "update_binding". The initializers appears as keys in "update_binding" are considered mutable variables. This implies some behaviors as described below.

  1. We have only unique keys in all "update_binding"s so that two variables may not have the same name. This ensures that one variable is assigned up to once. 2. The keys must appear in names of "ModelProto.graph.initializer" or "TrainingInfoProto.algorithm.initializer". 3. The values must be output names of "algorithm" or "ModelProto.graph.output". 4. Mutable variables are initialized to the value specified by the corresponding initializer, and then potentially updated by "initializer_binding"s and "update_binding"s in "TrainingInfoProto"s. This field usually contains names of trainable tensors (in ModelProto.graph), optimizer states such as momentums in advanced stochastic gradient methods (in TrainingInfoProto.graph), and number of training iterations (in TrainingInfoProto.graph). By default, this field is empty and no initializer would be changed by the execution of "algorithm".
Annotations
@SerialVersionUID()
Linear Supertypes
Updatable[TrainingInfoProto], GeneratedMessage, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TrainingInfoProto
  2. Updatable
  3. GeneratedMessage
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new TrainingInfoProto(initialization: Option[GraphProto] = _root_.scala.None, algorithm: Option[GraphProto] = _root_.scala.None, initializationBinding: Seq[StringStringEntryProto] = _root_.scala.Seq.empty, updateBinding: Seq[StringStringEntryProto] = _root_.scala.Seq.empty, unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty)

    initialization

    This field describes a graph to compute the initial tensors upon starting the training process. Initialization graph has no input and can have multiple outputs. Usually, trainable tensors in neural networks are randomly initialized. To achieve that, for each tensor, the user can put a random number operator such as RandomNormal or RandomUniform in TrainingInfoProto.initialization.node and assign its random output to the specific tensor using "initialization_binding". This graph can also set the initializers in "algorithm" in the same TrainingInfoProto; a use case is resetting the number of training iteration to zero. By default, this field is an empty graph and its evaluation does not produce any output. Thus, no initializer would be changed by default.

    algorithm

    This field represents a training algorithm step. Given required inputs, it computes outputs to update initializers in its own or inference graph's initializer lists. In general, this field contains loss node, gradient node, optimizer node, increment of iteration count. An execution of the training algorithm step is performed by executing the graph obtained by combining the inference graph (namely "ModelProto.graph") and the "algorithm" graph. That is, the actual the actual input/initializer/output/node/value_info/sparse_initializer list of the training graph is the concatenation of "ModelProto.graph.input/initializer/output/node/value_info/sparse_initializer" and "algorithm.input/initializer/output/node/value_info/sparse_initializer" in that order. This combined graph must satisfy the normal ONNX conditions. Now, let's provide a visualization of graph combination for clarity. Let the inference graph (i.e., "ModelProto.graph") be tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d and the "algorithm" graph be tensor_d -> Add -> tensor_e The combination process results tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d -> Add -> tensor_e Notice that an input of a node in the "algorithm" graph may reference the output of a node in the inference graph (but not the other way round). Also, inference node cannot reference inputs of "algorithm". With these restrictions, inference graph can always be run independently without training information. By default, this field is an empty graph and its evaluation does not produce any output. Evaluating the default training step never update any initializers.

    initializationBinding

    This field specifies the bindings from the outputs of "initialization" to some initializers in "ModelProto.graph.initializer" and the "algorithm.initializer" in the same TrainingInfoProto. See "update_binding" below for details. By default, this field is empty and no initializer would be changed by the execution of "initialization".

    updateBinding

    Gradient-based training is usually an iterative procedure. In one gradient descent iteration, we apply x = x - r * g where "x" is the optimized tensor, "r" stands for learning rate, and "g" is gradient of "x" with respect to a chosen loss. To avoid adding assignments into the training graph, we split the update equation into y = x - r * g x = y The user needs to save "y = x - r * g" into TrainingInfoProto.algorithm. To tell that "y" should be assigned to "x", the field "update_binding" may contain a key-value pair of strings, "x" (key of StringStringEntryProto) and "y" (value of StringStringEntryProto). For a neural network with multiple trainable (mutable) tensors, there can be multiple key-value pairs in "update_binding". The initializers appears as keys in "update_binding" are considered mutable variables. This implies some behaviors as described below.

    1. We have only unique keys in all "update_binding"s so that two variables may not have the same name. This ensures that one variable is assigned up to once. 2. The keys must appear in names of "ModelProto.graph.initializer" or "TrainingInfoProto.algorithm.initializer". 3. The values must be output names of "algorithm" or "ModelProto.graph.output". 4. Mutable variables are initialized to the value specified by the corresponding initializer, and then potentially updated by "initializer_binding"s and "update_binding"s in "TrainingInfoProto"s. This field usually contains names of trainable tensors (in ModelProto.graph), optimizer states such as momentums in advanced stochastic gradient methods (in TrainingInfoProto.graph), and number of training iterations (in TrainingInfoProto.graph). By default, this field is empty and no initializer would be changed by the execution of "algorithm".

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addAllInitializationBinding(__vs: Iterable[StringStringEntryProto]): TrainingInfoProto
  5. def addAllUpdateBinding(__vs: Iterable[StringStringEntryProto]): TrainingInfoProto
  6. def addInitializationBinding(__vs: StringStringEntryProto*): TrainingInfoProto
  7. def addUpdateBinding(__vs: StringStringEntryProto*): TrainingInfoProto
  8. val algorithm: Option[GraphProto]
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clearAlgorithm: TrainingInfoProto
  11. def clearInitialization: TrainingInfoProto
  12. def clearInitializationBinding: TrainingInfoProto
  13. def clearUpdateBinding: TrainingInfoProto
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  15. def companion: TrainingInfoProto.type
    Definition Classes
    TrainingInfoProto → GeneratedMessage
  16. def discardUnknownFields: TrainingInfoProto
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def getAlgorithm: GraphProto
  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  20. def getField(__field: FieldDescriptor): PValue
    Definition Classes
    TrainingInfoProto → GeneratedMessage
  21. def getFieldByNumber(__fieldNumber: Int): Any
    Definition Classes
    TrainingInfoProto → GeneratedMessage
  22. def getInitialization: GraphProto
  23. val initialization: Option[GraphProto]
  24. val initializationBinding: Seq[StringStringEntryProto]
  25. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  29. def productElementNames: Iterator[String]
    Definition Classes
    Product
  30. def serializedSize: Int
    Definition Classes
    TrainingInfoProto → GeneratedMessage
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. final def toByteArray: Array[Byte]
    Definition Classes
    GeneratedMessage
  33. final def toByteString: ByteString
    Definition Classes
    GeneratedMessage
  34. final def toPMessage: PMessage
    Definition Classes
    GeneratedMessage
  35. def toProtoString: String
    Definition Classes
    TrainingInfoProto → GeneratedMessage
  36. val unknownFields: UnknownFieldSet
  37. def update(ms: (Lens[TrainingInfoProto, TrainingInfoProto]) => Mutation[TrainingInfoProto]*): TrainingInfoProto
    Definition Classes
    Updatable
  38. val updateBinding: Seq[StringStringEntryProto]
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. def withAlgorithm(__v: GraphProto): TrainingInfoProto
  43. def withInitialization(__v: GraphProto): TrainingInfoProto
  44. def withInitializationBinding(__v: Seq[StringStringEntryProto]): TrainingInfoProto
  45. def withUnknownFields(__v: UnknownFieldSet): TrainingInfoProto
  46. def withUpdateBinding(__v: Seq[StringStringEntryProto]): TrainingInfoProto
  47. final def writeDelimitedTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage
  48. def writeTo(_output__: CodedOutputStream): Unit
    Definition Classes
    TrainingInfoProto → GeneratedMessage
  49. final def writeTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Updatable[TrainingInfoProto]

Inherited from GeneratedMessage

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped