deepr.exporters package

Submodules

deepr.exporters.base module

Base class for Exporters

class deepr.exporters.base.Exporter[source]

Bases: ABC

Base class for Exporters

abstract export(estimator)[source]

deepr.exporters.best_checkpoint module

Best Checkpoint Exporter

class deepr.exporters.best_checkpoint.BestCheckpoint(metric, mode=BestMode.DECREASE, use_mlflow=False, tag='training_best_step')[source]

Bases: Exporter

Overrides Checkpoint Information to point to the best checkpoint.

The best checkpoint is the one whose step is closest to the step of the best evaluation metric. The evaluation metrics are retrieved from the evaluation summaries (located in eval).

metric

Name of the metric used to select the best checkpoint

Type:

str

mode

If ‘decrease’, means lower is better.

Type:

str

tag

Tag for MLFlow

Type:

str

use_mlflow

If True, will log the best checkpoint step as tag to MLFlow

Type:

bool

export(estimator)[source]
class deepr.exporters.best_checkpoint.BestMode(value)[source]

Bases: Enum

Modes for early stopping

DECREASE: str = 'decrease'
INCREASE: str = 'increase'
deepr.exporters.best_checkpoint.read_eval_metrics(eval_dir)[source]

Reload summaries from model_dir

Return type:

Dict

deepr.exporters.save_variables module

Save Variables Exporter

class deepr.exporters.save_variables.SaveVariables(path_variables, variable_names, chunk_size=100000, compression='snappy')[source]

Bases: Exporter

Save Variables as Parquet, supports chunking.

path_variables

Path to export directory

Type:

str

variable_names

Name of variables from the Tensorflow Graph.

Type:

str

chunk_size

Number of elements per checkpoint

Type:

int

compression

Type of compression, default to “snappy”

Type:

str

export(estimator)[source]

deepr.exporters.saved_model module

Saved Model Exporter

class deepr.exporters.saved_model.SavedModel(path_saved_model, fields)[source]

Bases: Exporter

Saved Model Exporter

path_saved_model

Path to saved_model directory

Type:

str

fields

List of field to build the input_receiver_fn.

Type:

List[Field]

export(estimator)[source]

Module contents