TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfx.components.example_gen.import_example_gen.component.ImportExampleGen

View source on GitHub

Class ImportExampleGen

Official TFX ImportExampleGen component.

Inherits From: FileBasedExampleGen

The ImportExampleGen component takes TFRecord files with TF Example data format, and generates train and eval examples for downsteam components. This component provides consistent and configurable partition, and it also shuffle the dataset for ML best practice.

__init__

View source

__init__(
    input_base=None,
    input_config=None,
    output_config=None,
    example_artifacts=None,
    input=None,
    instance_name=None
)

Construct an ImportExampleGen component.

Args:

  • input_base: A Channel of 'ExternalPath' type, which includes one artifact whose uri is an external directory with TFRecord files inside (required).
  • input_config: An example_gen_pb2.Input instance, providing input configuration. If unset, the files under input_base will be treated as a single split.
  • output_config: An example_gen_pb2.Output instance, providing output configuration. If unset, default splits will be 'train' and 'eval' with size 2:1.
  • example_artifacts: Optional channel of 'ExamplesPath' for output train and eval examples.
  • input: Forwards compatibility alias for the 'input_base' argument.
  • instance_name: Optional unique instance name. Necessary if multiple ImportExampleGen components are declared in the same pipeline.

Child Classes

class DRIVER_CLASS

class SPEC_CLASS

Properties

component_id

Component id, unique across all component instances in a pipeline.

If unique name is available, component_id will be: . otherwise, component_id will be:

Returns:

component id.

component_type

downstream_nodes

exec_properties

inputs

outputs

upstream_nodes

Methods

add_downstream_node

View source

add_downstream_node(downstream_node)

add_upstream_node

View source

add_upstream_node(upstream_node)

Class Members

  • EXECUTOR_SPEC