SingleSWD¶
Inheritance Diagram

-
class
ashpy.metrics.sliced_wasserstein_metric.SingleSWD(model_selection_operator=<built-in function lt>, logdir=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/ashpy/checkouts/master/docs/source/log'), level_of_pyramid=0, real_or_fake='fake')[source]¶ Bases:
ashpy.metrics.metric.MetricSlicedWassersteinDistance for a certain level of the pyramid.
Methods
__init__([model_selection_operator, logdir, …])Initialize the Metric. update_state(context, score)Update the internal state of the metric, using the information from the context object. Attributes
best_folderRetrieve the folder used to save the best model when doing model selection. best_model_sel_fileRetrieve the path to JSON file containing the measured performance of the best model. logdirRetrieve the log directory. metricRetrieve the tf.keras.metrics.Metricobject.model_selection_operatorRetrieve the operator used for model selection. nameRetrieve the metric name. sanitized_nameall / are _. -
__init__(model_selection_operator=<built-in function lt>, logdir=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/ashpy/checkouts/master/docs/source/log'), level_of_pyramid=0, real_or_fake='fake')[source]¶ Initialize the Metric.
Parameters: - model_selection_operator (
typing.Callable) –The operation that will be used when model_selection is triggered to compare the metrics, used by the update_state. Any
typing.Callablebehaving like anoperatoris accepted.Note
Model selection is done ONLY if an operator is specified here.
- logdir (str) – Path to the log dir, defaults to a log folder in the current directory.
- level_of_pyramid (int) – Level of the pyramid related to this metric.
- real_or_fake (str) – string identifying this metric (real or fake distance).
Return type: None- model_selection_operator (
-
update_state(context, score)[source]¶ Update the internal state of the metric, using the information from the context object.
Parameters: context ( ashpy.contexts.gan.GANContext) – An AshPy Context Object that carries all the information the Metric needs.Return type: None
-