Join the SIG TFX-Addons community and help make TFX even better!

tfx.v1.components.BulkInferrer

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

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 Channel of type standard_artifacts.Examples, usually produced by an ExampleGen component. required
model A Channel of type standard_artifacts.Model, usually produced by a Trainer component.
model_blessing A Channel of type standard_artifacts.ModelBlessing, usually produced by a ModelValidator component.
data_spec bulk_inferrer_pb2.DataSpec instance that describes data selection. If any field is provided as a RuntimeParameter, data_spec should be constructed as a dict with the same field names as DataSpec proto message.
model_spec bulk_inferrer_pb2.ModelSpec instance that describes model specification. If any field is provided as a RuntimeParameter, model_spec should be constructed as a dict with the same field names as ModelSpec proto message.
output_example_spec bulk_inferrer_pb2.OutputExampleSpec instance, specify if you want BulkInferrer to output examples instead of inference result. If any field is provided as a RuntimeParameter, output_example_spec should be constructed as a dict with the same field names as OutputExampleSpec proto message.

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.