tfx.v1.components.BulkInferrer

A TFX component to do batch inference on a model with unlabelled examples.

Inherits From: BaseBeamComponent, BaseComponent, BaseNode

BulkInferrer consumes examples data and a model, and produces the inference results to an external location as PredictionLog proto.

BulkInferrer will infer on validated model.

Example

  # Uses BulkInferrer to inference on examples.
  bulk_inferrer = BulkInferrer(
      examples=example_gen.outputs['examples'],
      model=trainer.outputs['model'])

Component outputs contains:

See the BulkInferrer guide for more details.

examples A BaseChannel of type standard_artifacts.Examples, usually produced by an ExampleGen component. required
model A BaseChannel of type standard_artifacts.Model, usually produced by a Trainer component.
model_blessing A BaseChannel of type standard_artifacts.ModelBlessing, usually produced by a ModelValidator component.
data_spec bulk_inferrer_pb2.DataSpec instance that describes data selection.
model_spec bulk_inferrer_pb2.ModelSpec instance that describes model specification.
output_example_spec bulk_inferrer_pb2.OutputExampleSpec instance, specify if you want BulkInferrer to output examples instead of inference result.

outputs Component's output channel dict.

Methods

with_beam_pipeline_args

Add per component Beam pipeline args.

Args
beam_pipeline_args List of Beam pipeline args to be added to the Beam executor spec.

Returns
the same component itself.

with_node_execution_options

POST_EXECUTABLE_SPEC None
PRE_EXECUTABLE_SPEC None