BaseContext¶
Inheritance Diagram

-
class
ashpy.contexts.base_context.BaseContext(metrics=None, dataset=None, log_eval_mode=<LogEvalMode.TEST: 0>, global_step=<tf.Variable 'global_step:0' shape=() dtype=int64, numpy=0>, ckpt=None)[source]¶ Bases:
objectashpy.contexts.BaseContextprovide an interface for all contexts.Methods
__init__([metrics, dataset, log_eval_mode, …])Initialize the Context.
Measure the metrics.
Use the metrics to perform model selection.
Attributes
Retrieve the dataset.
Retrieve the global_step.
Retrieve model(s) mode.
Retrieve the metrics.
-
__init__(metrics=None, dataset=None, log_eval_mode=<LogEvalMode.TEST: 0>, global_step=<tf.Variable 'global_step:0' shape=() dtype=int64, numpy=0>, ckpt=None)[source]¶ Initialize the Context.
- Parameters
metrics (
listof [ashpy.metrics.metric.Metric]) – List ofashpy.metrics.metric.Metricobjects.dataset (
tf.data.Dataset) – The dataset to use, that contains everything needed to use the model in this context.log_eval_mode (
ashpy.modes.LogEvalMode) – Models’ mode to use when evaluating and logging.global_step (
tf.Variable) – Keeps track of the training steps.ckpt (
tf.train.Checkpoint) – Checkpoint to use to keep track of models status.
- Return type
None
-
property
dataset¶ Retrieve the dataset.
- Return type
DatasetV2- Returns
-
property
global_step¶ Retrieve the global_step.
- Return type
Variable- Returns
-
property
log_eval_mode¶ Retrieve model(s) mode.
- Return type
- Returns
-
property
metrics¶ Retrieve the metrics.
- Return type
- Returns
-