Class/Object

org.platanios.tensorflow.api.learn.estimators

FileBasedEstimator

Related Docs: object FileBasedEstimator | package estimators

Permalink

class FileBasedEstimator[IT, IO, ID, IS, I, TT, TO, TD, TS, EI] extends Estimator[IT, IO, ID, IS, I, TT, TO, TD, TS, EI]

File-based estimator which is used to train, use, and evaluate TensorFlow models, and uses checkpoint files for storing and retrieving its state. This means that checkpoint files are written after every call to train() and are loaded on every call to infer() or evaluate().

Linear Supertypes
Estimator[IT, IO, ID, IS, I, TT, TO, TD, TS, EI], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileBasedEstimator
  2. Estimator
  3. AnyRef
  4. 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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def checkpointConfig: CheckpointConfig

    Permalink

    Checkpoint configuration used by this estimator.

    Checkpoint configuration used by this estimator.

    Definition Classes
    Estimator
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val configuration: Configuration

    Permalink

    Run configuration used for this estimator.

    Run configuration used for this estimator.

    Definition Classes
    Estimator
  8. val configurationBase: Configuration

    Permalink

    Configuration base for this estimator.

    Configuration base for this estimator. This allows for setting up distributed training environments, for example. Note that this is a *base* for a configuration because the estimator might modify it and set some missing fields to appropriate default values, in order to obtain its final configuration that can be obtain through its configuration field.

    Attributes
    protected
    Definition Classes
    FileBasedEstimatorEstimator
  9. val deviceFunction: Option[(OpSpecification) ⇒ String]

    Permalink

    Device function used by this estimator for managing replica device placement when using distributed training.

    Device function used by this estimator for managing replica device placement when using distributed training.

    Definition Classes
    Estimator
  10. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def evaluate(data: () ⇒ Dataset[TT, TO, TD, TS], metrics: Seq[Metric[EI, ops.Output]] = this.evaluationMetrics, maxSteps: Long = 1L, saveSummaries: Boolean = true, name: String = null): Seq[tensors.Tensor[types.FLOAT32]]

    Permalink

    Evaluates the model managed by this estimator given the provided evaluation data, data.

    Evaluates the model managed by this estimator given the provided evaluation data, data.

    The evaluation process is iterative. In each step, a data batch is obtained from data and internal metric value accumulators are updated. The number of steps to perform is controlled through the maxSteps argument. If set to -1, then all batches from data will be processed.

    If metrics is provided, it overrides the value provided in the constructor of this estimator.

    data

    Evaluation dataset. Each element is a tuple over input and training inputs (i.e., supervision labels).

    metrics

    Evaluation metrics to use.

    maxSteps

    Maximum number of evaluation steps to perform. If -1, the evaluation process will run until data is exhausted.

    saveSummaries

    Boolean indicator specifying whether to save the evaluation results as summaries in the working directory of this estimator.

    name

    Name for this evaluation. If provided, it will be used to generate an appropriate directory name for the resulting summaries. If saveSummaries is false, this argument has no effect. This is useful if the user needs to run multiple evaluations on different data sets, such as on training data vs test data. Metrics for different evaluations are saved in separate folders, and appear separately in TensorBoard.

    returns

    Evaluation metric values at the end of the evaluation process. The return sequence matches the ordering of metrics.

    Definition Classes
    FileBasedEstimatorEstimator
    Annotations
    @throws( ... )
    Exceptions thrown

    InvalidArgumentException If saveSummaries is true, but the estimator has no working directory specified.

  13. val evaluateHooks: Set[Hook]

    Permalink

    Hooks to use while evaluating.

  14. def evaluateWithHooks(data: () ⇒ Dataset[TT, TO, TD, TS], metrics: Seq[Metric[EI, ops.Output]] = this.evaluationMetrics, maxSteps: Long = 1L, hooks: Set[Hook] = evaluateHooks, checkpointPath: Path = null, saveSummaries: Boolean = true, name: String = null): Seq[tensors.Tensor[types.FLOAT32]]

    Permalink

    Evaluates the model managed by this estimator given the provided evaluation data, data.

    Evaluates the model managed by this estimator given the provided evaluation data, data.

    This method requires that a checkpoint can be found in either checkpointPath, if provided, or in this estimator's working directory. It first loads the trained parameter values from the checkpoint specified by checkpointPath or from the latest checkpoint found in the working directory, and it then computes predictions for input.

    The evaluation process is iterative. In each step, a data batch is obtained from data and internal metric value accumulators are updated. The number of steps to perform is controlled through the maxSteps argument. If set to -1, then all batches from data will be processed.

    If hooks or metrics are provided, they override the values provided in the constructor of this estimator.

    data

    Evaluation dataset. Each element is a tuple over input and training inputs (i.e., supervision labels).

    metrics

    Evaluation metrics to use.

    maxSteps

    Maximum number of evaluation steps to perform. If -1, the evaluation process will run until data is exhausted.

    hooks

    Hooks to use while evaluating.

    checkpointPath

    Path to a checkpoint file to use. If null, then the latest checkpoint found in this estimator's working directory will be used.

    saveSummaries

    Boolean indicator specifying whether to save the evaluation results as summaries in the working directory of this estimator.

    name

    Name for this evaluation. If provided, it will be used to generate an appropriate directory name for the resulting summaries. If saveSummaries is false, this argument has no effect. This is useful if the user needs to run multiple evaluations on different data sets, such as on training data vs test data. Metrics for different evaluations are saved in separate folders, and appear separately in TensorBoard.

    returns

    Evaluation metric values at the end of the evaluation process. The return sequence matches the ordering of metrics.

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

    CheckpointNotFoundException If no checkpoint could be found. This can happen if checkpointPath is null and no checkpoint could be found in this estimator's working directory.

    InvalidArgumentException If saveSummaries is true, but the estimator has no working directory specified.

  15. val evaluationMetrics: Seq[Metric[EI, ops.Output]]

    Permalink

    Evaluation metrics to use.

  16. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. def getOrCreateSaver(): Option[Saver]

    Permalink

    Gets an existing saver from the current graph, or creates a new one if none exists.

    Gets an existing saver from the current graph, or creates a new one if none exists.

    Attributes
    protected
    Definition Classes
    Estimator
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. def infer[InferInput, InferOutput, ModelInferenceOutput](input: () ⇒ InferInput)(implicit evFetchableIO: Aux[IO, IT], evFetchableI: Aux[I, ModelInferenceOutput], evFetchableIIO: Aux[(IO, I), (IT, ModelInferenceOutput)], ev: SupportedInferInput[InferInput, InferOutput, IT, IO, ID, IS, ModelInferenceOutput]): InferOutput

    Permalink

    Infers output (i.e., computes predictions) for input using the model managed by this estimator.

    Infers output (i.e., computes predictions) for input using the model managed by this estimator.

    input can be of one of the following types:

    • A Dataset, in which case this method returns an iterator over (input, output) tuples corresponding to each element in the dataset. Note that the predictions are computed lazily in this case, whenever an element is requested from the returned iterator.
    • A single input of type IT, in which case this method returns a prediction of type I.

    Note that, ModelInferenceOutput refers to the tensor type that corresponds to the symbolic type I. For example, if I is (Output, Output), then ModelInferenceOutput will be (Tensor, Tensor).

    input

    Input for the predictions.

    returns

    Either an iterator over (IT, ModelInferenceOutput) tuples, or a single element of type I, depending on the type of input.

    Definition Classes
    FileBasedEstimatorEstimator
  21. val inferHooks: Set[Hook]

    Permalink

    Hooks to use while inferring.

  22. def inferWithHooks[InferInput, InferOutput, ModelInferenceOutput](input: () ⇒ InferInput, hooks: Set[Hook] = inferHooks, checkpointPath: Path = null)(implicit evFetchableIO: Aux[IO, IT], evFetchableI: Aux[I, ModelInferenceOutput], evFetchableIIO: Aux[(IO, I), (IT, ModelInferenceOutput)], ev: SupportedInferInput[InferInput, InferOutput, IT, IO, ID, IS, ModelInferenceOutput]): InferOutput

    Permalink

    Infers output (i.e., computes predictions) for input using the model managed by this estimator.

    Infers output (i.e., computes predictions) for input using the model managed by this estimator.

    This method requires that a checkpoint can be found in either checkpointPath, if provided, or in this estimator's working directory. It first loads the trained parameter values from the checkpoint specified by checkpointPath or from the latest checkpoint found in the working directory, and it then computes predictions for input.

    input can be of one of the following types:

    • A Dataset, in which case this method returns an iterator over (input, output) tuples corresponding to each element in the dataset. Note that the predictions are computed lazily in this case, whenever an element is requested from the returned iterator.
    • A single input of type IT, in which case this method returns a prediction of type I.

    Note that, ModelInferenceOutput refers to the tensor type that corresponds to the symbolic type I. For example, if I is (Output, Output), then ModelInferenceOutput will be (Tensor, Tensor).

    If hooks is provided, it overrides the value provided in the constructor of this estimator.

    input

    Input for the predictions.

    hooks

    Hooks to use while making predictions.

    checkpointPath

    Path to a checkpoint file to use. If null, then the latest checkpoint found in this estimator's working directory will be used.

    returns

    Either an iterator over (IT, ModelInferenceOutput) tuples, or a single element of type I, depending on the type of input.

    Annotations
    @throws( ... )
    Exceptions thrown

    CheckpointNotFoundException If no checkpoint could be found. This can happen if checkpointPath is null and no checkpoint could be found in this estimator's working directory.

  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. val modelFunction: ModelFunction[IT, IO, ID, IS, I, TT, TO, TD, TS, EI]

    Permalink

    Model-generating function that can optionally have a Configuration argument which will be used to pass the estimator's configuration to the model and allows customizing the model based on the execution environment.

    Model-generating function that can optionally have a Configuration argument which will be used to pass the estimator's configuration to the model and allows customizing the model based on the execution environment.

    Attributes
    protected
    Definition Classes
    FileBasedEstimatorEstimator
  25. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  28. def randomSeed: Option[Int]

    Permalink

    Random seed value to be used by the TensorFlow initializers in this estimator.

    Random seed value to be used by the TensorFlow initializers in this estimator.

    Definition Classes
    Estimator
  29. def saveEvaluationSummaries(step: Long, metrics: Seq[Metric[EI, ops.Output]], metricValues: Seq[tensors.Tensor[types.FLOAT32]], name: String = null): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Estimator
  30. def sessionConfig: Option[SessionConfig]

    Permalink

    Session configuration used by this estimator.

    Session configuration used by this estimator.

    Definition Classes
    Estimator
  31. val stopCriteria: StopCriteria

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

    Permalink
    Definition Classes
    AnyRef
  33. val tensorBoardConfig: TensorBoardConfig

    Permalink

    TensorBoard configuration to use while training.

    TensorBoard configuration to use while training. If provided, a TensorBoard server is launched while training, using the provided configuration. In that case, it is required that TensorBoard is installed for the default Python environment in the system. If training in a distributed setting, the TensorBoard server is launched on the chief node.

  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. def train(data: () ⇒ Dataset[TT, TO, TD, TS], stopCriteria: StopCriteria = this.stopCriteria): Unit

    Permalink

    Trains the model managed by this estimator.

    Trains the model managed by this estimator.

    data

    Training dataset. Each element is a tuple over input and training inputs (i.e., supervision labels).

    stopCriteria

    Stop criteria to use for stopping the training iteration. For the default criteria please refer to the documentation of StopCriteria.

    Definition Classes
    FileBasedEstimatorEstimator
  36. val trainChiefOnlyHooks: Set[Hook]

    Permalink

    Hooks to use while training for the chief node only.

    Hooks to use while training for the chief node only. This argument is only useful for a distributed training setting.

  37. val trainHooks: Set[Hook]

    Permalink

    Hooks to use while training (e.g., logging for the loss function value, etc.).

  38. def trainWithHooks(data: () ⇒ Dataset[TT, TO, TD, TS], stopCriteria: StopCriteria = this.stopCriteria, hooks: Set[Hook] = trainHooks, chiefOnlyHooks: Set[Hook] = trainChiefOnlyHooks, tensorBoardConfig: TensorBoardConfig = this.tensorBoardConfig): Unit

    Permalink

    Trains the model managed by this estimator.

    Trains the model managed by this estimator.

    NOTE: If you provide any summary saver or checkpoint saver hooks in hooks or chiefOnlyHooks, then the checkpoint configuration in this estimator's configuration will be ignored for the chief and those hooks will be used instead.

    If any of hooks, chiefOnlyHooks, or tensorBoardConfig are provided, they override the values provided in the constructor of this estimator.

    data

    Training dataset. Each element is a tuple over input and training inputs (i.e., supervision labels).

    stopCriteria

    Stop criteria to use for stopping the training iteration. For the default criteria please refer to the documentation of StopCriteria.

    hooks

    Hooks to use while training (e.g., logging for the loss function value, etc.).

    chiefOnlyHooks

    Hooks to use while training for the chief node only. This argument is only useful for a distributed training setting.

    tensorBoardConfig

    If provided, a TensorBoard server is launched using the provided configuration. In that case, it is required that TensorBoard is installed for the default Python environment in the system. If training in a distributed setting, the TensorBoard server is launched on the chief node.

  39. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def workingDir: Option[Path]

    Permalink

    Working directory used by this estimator, used to save model parameters, graph, etc.

    Working directory used by this estimator, used to save model parameters, graph, etc. It can also be used to load checkpoints for a previously saved model.

    Definition Classes
    Estimator

Inherited from Estimator[IT, IO, ID, IS, I, TT, TO, TD, TS, EI]

Inherited from AnyRef

Inherited from Any

Ungrouped