Trait/Object

org.platanios.tensorflow.api.ops.variables

SaverDefBuilder

Related Docs: object SaverDefBuilder | package variables

Permalink

trait SaverDefBuilder extends AnyRef

A saver builder is used to build SaverDef objects.

Most users shall never have to worry about dealing with saver builders. The Saver constructor uses DefaultSaverDefBuilder by default, which should be fine for most applications.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SaverDefBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 addRestoreOps(prefix: Output, saveables: Set[Saveable], reshape: Boolean, restoreSequentially: Boolean, name: String = "Restore"): Op

    Permalink

    Adds ops to restore objects that are on the same shard.

    Adds ops to restore objects that are on the same shard.

    prefix

    String tensor containing a single element. That element corresponds to the prefix of a V2 checkpoint. For example, "/fs/train/ckpt-<step>/tmp/worker-"`. Note that is the V1 checkpoint format is being used (which is deprecated), then this prefix is interpreted as a filename instead.

    saveables

    Sequence of saveable objects that the created op will restore.

    reshape

    Boolean value indicating whether to reshape loaded tensors to the shape of the corresponding saveable object.

    restoreSequentially

    Boolean value indicating whether to restore variables objects within a shard.

    name

    Name for the created op.

    returns

    Created op.

    Attributes
    protected
  5. def addSaveOps(prefix: Output, saveables: Set[Saveable], name: String = "Save"): Output

    Permalink

    Adds ops to save objects that are on the same shard and returns a tensor containing the filename used for the save operation.

    Adds ops to save objects that are on the same shard and returns a tensor containing the filename used for the save operation.

    prefix

    String tensor containing a single element. That element corresponds to the prefix of a V2 checkpoint. For example, "/fs/train/ckpt-<step>/tmp/worker-"`. Note that is the V1 checkpoint format is being used (which is deprecated), then this prefix is interpreted as a filename instead.

    saveables

    Sequence of saveable objects that the created op will save.

    name

    Name for the created op.

    returns

    Scalar string tensor containing the filename used for the save operation.

    Attributes
    protected
  6. def addShardedRestoreOps(prefix: Output, saveablesByDevice: Seq[(String, Set[Saveable])], reshape: Boolean, restoreSequentially: Boolean, name: String = "Restore"): Op

    Permalink

    Adds ops to restore sharded (per device) objects.

    Adds ops to restore sharded (per device) objects.

    prefix

    String tensor containing a single element. That element corresponds to the prefix of a V2 checkpoint. For example, "/fs/train/ckpt-<step>/tmp/worker-"`. Note that is the V1 checkpoint format is being used (which is deprecated), then this prefix is interpreted as a filename instead.

    saveablesByDevice

    Sequence of device-saveables pairs to restore, sorted by ascending device name. This is the result of the SaverDefBuilder.groupByDevice method.

    reshape

    Boolean value indicating whether to reshape loaded tensors to the shape of the corresponding saveable object.

    restoreSequentially

    Boolean value indicating whether to restore variables objects within a shard.

    name

    Name for the created op.

    returns

    Created op.

    Attributes
    protected
  7. def addShardedSaveOps(prefix: Output, saveablesByDevice: Seq[(String, Set[Saveable])]): Output

    Permalink

    Adds ops to save sharded (per device) objects.

    Adds ops to save sharded (per device) objects.

    Note that the sharded save procedure for the V2 checkpoint format is different than that for V1. There is a special "merge" step that merges the small metadata produced from each device.

    prefix

    String tensor containing a single element. That element corresponds to the prefix of a V2 checkpoint. For example, "/fs/train/ckpt-<step>/tmp/worker-"`. Note that is the V1 checkpoint format is being used (which is deprecated), then this prefix is interpreted as a filename instead.

    saveablesByDevice

    Sequence of device-saveables pairs, sorted by ascending device name. This is the result of the SaverDefBuilder.groupByDevice method.

    returns

    Scalar string tensor containing the filename used for the save operation.

    Attributes
    protected
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def build(saveables: Set[Saveable], reshape: Boolean = false, sharded: Boolean = false, maxToKeep: Int = 5, keepCheckpointEveryNHours: Float = 10000.0f, restoreSequentially: Boolean = false, filename: String = "model", name: String = "Saver"): SaverDef

    Permalink

    Adds save/restore nodes to the graph and creates and returns a SaverDef proto.

    Adds save/restore nodes to the graph and creates and returns a SaverDef proto.

    saveables

    Objects that need to be saved and loaded.

    reshape

    Boolean value which, if true, allows restoring parameters from a checkpoint where the parameters have a different shape. This is only needed when you try to restore from a Dist-Belief checkpoint, and only some times.

    sharded

    Boolean value which, if true, will shard the checkpoints, one per device that is used by the provided saveables.

    maxToKeep

    Maximum number of checkpoints to keep. As new checkpoints are created, old ones are deleted. If 0, no checkpoints are deleted from the filesystem but only the last one is kept in the checkpoint file. Presently the number is only roughly enforced. For example, in the case of restarts more than maxToKeep checkpoints may be kept.

    keepCheckpointEveryNHours

    Denotes how often checkpoints should be saved, in hour units. Defaults to 10,000 hours.

    restoreSequentially

    Boolean value which, if true, causes the restoration of different variables to happen sequentially within each device.

    filename

    Filename used for the saveable objects saving and loading.

    name

    Name scope for the created ops.

    returns

    Created SaverDef object.

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  20. def restore(prefix: Output, saveable: Saveable, name: String = "Restore"): Seq[Output]

    Permalink

    Creates an op that restores the tensors that constitute saveable.

    Creates an op that restores the tensors that constitute saveable.

    Note that this method is intended to be overridden by subclasses that want to generate different types of ops.

    prefix

    String tensor containing a single element. That element corresponds to the prefix of a V2 checkpoint. For example, "/fs/train/ckpt-<step>/tmp/worker-"`. Note that is the V1 checkpoint format is being used (which is deprecated), then this prefix is interpreted as a filename instead.

    saveable

    Saveable object that the created op will restore.

    name

    Name for the created op.

    returns

    Created op outputs (restored tensors that constitute saveable).

    Attributes
    protected
  21. def save(prefix: Output, saveables: Set[Saveable], name: String = "Save"): Op

    Permalink

    Creates an op that saves the provided sequence of saveables into a file.

    Creates an op that saves the provided sequence of saveables into a file.

    Note that this method is intended to be overridden by subclasses that want to generate different types of ops.

    prefix

    String tensor containing a single element. That element corresponds to the prefix of a V2 checkpoint. For example, "/fs/train/ckpt-<step>/tmp/worker-"`. Note that is the V1 checkpoint format is being used (which is deprecated), then this prefix is interpreted as a filename instead.

    saveables

    Sequence of saveable objects that the created op will save.

    name

    Name for the created op.

    returns

    Created op.

    Attributes
    protected
    Annotations
    @throws( ... )
    Exceptions thrown

    IllegalArgumentException If an unsupported checkpoint format version is being used.

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

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped