merlin.systems.dag.ops.tensorflow.PredictTensorflow

class merlin.systems.dag.ops.tensorflow.PredictTensorflow(model_or_path, custom_objects: Optional[dict] = None, backend='tensorflow')[source]

Bases: merlin.systems.dag.ops.operator.InferenceOperator

TensorFlow Model Prediction Operator.

__init__(model_or_path, custom_objects: Optional[dict] = None, backend='tensorflow')[source]

Instantiate a PredictTensorflow inference operator.

Parameters
  • model_or_path (Tensorflow model or string) – This can be a tensorflow model or a path to a tensorflow model.

  • custom_objects (dict, optional) – Any custom objects that need to be loaded with the model, by default None.

Methods

__init__(model_or_path[, custom_objects, …])

Instantiate a PredictTensorflow inference operator.

column_mapping(col_selector)

Compute which output columns depend on which input columns

compute_column_schema(col_name, input_schema)

compute_input_schema(root_schema, …)

Use the input schema supplied during object creation.

compute_output_schema(input_schema, col_selector)

Use the output schema supplied during object creation.

compute_selector(input_schema, selector[, …])

Provides a hook method for sub-classes to override to implement custom column selection logic.

create_node(selector)

_summary_

export(path, input_schema, output_schema[, …])

Export the class object as a config and all related files to the user defined path.

from_model_registry(registry, **kwargs)

Loads the InferenceOperator from the provided ModelRegistry.

from_path(path, **kwargs)

load_artifacts(artifact_path)

Hook method that provides a way to load saved artifacts for the operator

output_column_names(col_selector)

Given a set of columns names returns the names of the transformed columns this operator will produce

transform(col_selector, transformable)

Run model inference.

validate_schemas(parents_schema, …[, …])

Provides a hook method that sub-classes can override to implement schema validation logic.

Attributes

dependencies

Defines an optional list of column dependencies for this operator.

dynamic_dtypes

export_name

Provides a clear common english identifier for this operator.

exportable_backends

is_subgraph

label

output_dtype

output_properties

output_tags

scalar_shape

supported_formats

supports

Returns what kind of data representation this operator supports

transform(col_selector: merlin.dag.selector.ColumnSelector, transformable: merlin.core.protocols.Transformable)merlin.core.protocols.Transformable[source]

Run model inference. Returning predictions.

Parameters
  • col_selector (ColumnSelector) – Unused ColumunSelector input

  • transformable (Transformable) – Input features to model

Returns

Model Predictions

Return type

Transformable

property export_name

Provides a clear common english identifier for this operator.

Returns

Name of the current class as spelled in module.

Return type

String

classmethod from_path(path, **kwargs)[source]
compute_input_schema(root_schema: merlin.schema.schema.Schema, parents_schema: merlin.schema.schema.Schema, deps_schema: merlin.schema.schema.Schema, selector: merlin.dag.selector.ColumnSelector)merlin.schema.schema.Schema[source]

Use the input schema supplied during object creation.

compute_output_schema(input_schema: merlin.schema.schema.Schema, col_selector: merlin.dag.selector.ColumnSelector, prev_output_schema: Optional[merlin.schema.schema.Schema] = None)merlin.schema.schema.Schema[source]

Use the output schema supplied during object creation.