Validator

class tfsnippet.Validator(**kwargs)

Bases: tfsnippet.trainer.evaluator.Evaluator

Class to compute validation loss and other metrics.

Attributes Summary

batch_weight_func Get the function to compute the metric weight for each mini-batch.
data_flow Get the validation data flow.
events Get the event source object.
feed_dict Get the fixed feed dict.
inputs Get the input placeholders.
last_metrics_dict Get the metric values from last evaluation.
loop Get the training loop object.
metrics Get the metrics to compute.
time_metric_name Get the metric name for collecting evaluation time usage.

Methods Summary

run([feed_dict]) Run evaluation.

Attributes Documentation

batch_weight_func

Get the function to compute the metric weight for each mini-batch.

data_flow

Get the validation data flow.

Returns:The validation data flow.
Return type:DataFlow
events

Get the event source object.

Returns:The event source object.
Return type:EventSource
feed_dict

Get the fixed feed dict.

Returns:The fixed feed dict.
Return type:dict[tf.Tensor, any]
inputs

Get the input placeholders.

Returns:The input placeholders.
Return type:list[tf.Tensor]
last_metrics_dict

Get the metric values from last evaluation.

Returns:The metric values dict.
Return type:dict[str, any]
loop

Get the training loop object.

Returns:The training loop object.
Return type:TrainLoop
metrics

Get the metrics to compute.

Returns:The metrics to compute.
Return type:OrderedDict[str, tf.Tensor]
time_metric_name

Get the metric name for collecting evaluation time usage.

Methods Documentation

run(feed_dict=None)

Run evaluation.

Parameters:feed_dict – The extra feed dict to be merged with the already configured dict. (default None)