ClassifierContext¶
Inheritance Diagram
-
class
ashpy.contexts.classifier.
ClassifierContext
(classifier_model=None, loss=None, dataset=None, metrics=None, log_eval_mode=<LogEvalMode.TEST: 1>, global_step=<tf.Variable 'global_step:0' shape=() dtype=int64, numpy=0>, checkpoint=None)[source]¶ Bases:
ashpy.contexts.context.Context
ashpy.ClassifierContext
provide the standard functions to test a classifier.Methods
__init__
([classifier_model, loss, dataset, …])Instantiate the ashpy.contexts.classifier.ClassifierContext
context.Attributes
classifier_model
Retrieve the Model Object. current_batch
Return the current batch. dataset
Retrieve the dataset. exception
Return the exception. global_step
Retrieve the global_step. log_eval_mode
Retrieve model(s) mode. loss
Retrieve the loss value. metrics
Retrieve the metrics. training_set
Return the training set. validation_set
Return the validation set. -
__init__
(classifier_model=None, loss=None, dataset=None, metrics=None, log_eval_mode=<LogEvalMode.TEST: 1>, global_step=<tf.Variable 'global_step:0' shape=() dtype=int64, numpy=0>, checkpoint=None)[source]¶ Instantiate the
ashpy.contexts.classifier.ClassifierContext
context.Parameters: - classifier_model (
tf.keras.Model
) – Atf.keras.Model
model. - loss (
ashpy.losses.executor.Executor
) – Loss function, format f(y_true, y_pred). - dataset (
tf.data.Dataset
) – The test dataset. - metrics (
list
of [ashpy.metrics.metric.Metric
]) – List ofashpy.metrics.metric.Metric
with which to measure training and validation data performances. - log_eval_mode (
ashpy.modes.LogEvalMode
) – Models’ mode to use when evaluating and logging. - global_step (
tf.Variable
) – tf.Variable that keeps track of the training steps. - checkpoint (
tf.train.Checkpoint
) – checkpoint to use to keep track of models status.
Return type: - classifier_model (
-
classifier_model
¶ Retrieve the Model Object.
Return type: Model
Returns: tf.keras.Model
– The classifier model.
-
training_set
¶ Return the training set.
Return type: DatasetV2
Returns: tf.data.Dataset
– The training set.
-
validation_set
¶ Return the validation set.
Return type: Optional
[DatasetV2
]Returns: tf.data.Dataset
– The validation set.
-