Exemplo n.º 1
0
 class SimpleComponentSpec(base_component.ComponentSpec):
     PARAMETERS = {
         'x': ExecutionParameter(type=int),
         'y': ExecutionParameter(type=int, optional=True),
     }
     INPUTS = {'z': ChannelParameter(type_name='Z')}
     OUTPUTS = {}
Exemplo n.º 2
0
class QueryBasedExampleGenSpec(base_component.ComponentSpec):
    """Query-based ExampleGen component spec."""

    PARAMETERS = {
        'input_config': ExecutionParameter(type=example_gen_pb2.Input),
        'output_config': ExecutionParameter(type=example_gen_pb2.Output),
    }
    INPUTS = {}
    OUTPUTS = {
        'examples': ChannelParameter(type_name='ExamplesPath'),
    }
Exemplo n.º 3
0
class _BasicComponentSpec(base_component.ComponentSpec):

    PARAMETERS = {
        'folds': ExecutionParameter(type=int),
        'proto': ExecutionParameter(type=example_gen_pb2.Input, optional=True),
    }
    INPUTS = {
        'input': ChannelParameter(type_name='InputType'),
    }
    OUTPUTS = {
        'output': ChannelParameter(type_name='OutputType'),
    }
Exemplo n.º 4
0
class FileBasedExampleGenSpec(base_component.ComponentSpec):
    """File-based ExampleGen component spec."""

    COMPONENT_NAME = 'ExampleGen'
    PARAMETERS = {
        'input_config': ExecutionParameter(type=example_gen_pb2.Input),
        'output_config': ExecutionParameter(type=example_gen_pb2.Output),
    }
    INPUTS = {
        'input_base': ChannelParameter(type_name='ExternalPath'),
    }
    OUTPUTS = {
        'examples': ChannelParameter(type_name='ExamplesPath'),
    }
Exemplo n.º 5
0
class SlackComponentSpec(base_component.ComponentSpec):
    """ComponentSpec for Custom TFX Slack Component."""

    PARAMETERS = {
        'slack_token': ExecutionParameter(type=Text),
        'channel_id': ExecutionParameter(type=Text),
        'timeout_sec': ExecutionParameter(type=int),
    }
    INPUTS = {
        'model_export': ChannelParameter(type_name='ModelExportPath'),
        'model_blessing': ChannelParameter(type_name='ModelBlessingPath'),
    }
    OUTPUTS = {
        'slack_blessing': ChannelParameter(type_name='ModelBlessingPath'),
    }
Exemplo n.º 6
0
class PusherSpec(base_component.ComponentSpec):
    """Pusher component spec."""

    PARAMETERS = {
        'push_destination':
        ExecutionParameter(type=pusher_pb2.PushDestination, optional=True),
        'custom_config':
        ExecutionParameter(type=Dict[Text, Any], optional=True),
    }
    INPUTS = {
        'model_export': ChannelParameter(type_name='ModelExportPath'),
        'model_blessing': ChannelParameter(type_name='ModelBlessingPath'),
    }
    OUTPUTS = {
        'model_push': ChannelParameter(type_name='ModelPushPath'),
    }
Exemplo n.º 7
0
class TrainerSpec(base_component.ComponentSpec):
    """Trainer component spec."""

    COMPONENT_NAME = 'Trainer'
    PARAMETERS = {
        'train_args': ExecutionParameter(type=trainer_pb2.TrainArgs),
        'eval_args': ExecutionParameter(type=trainer_pb2.EvalArgs),
        'module_file': ExecutionParameter(type=(str, Text)),
        'custom_config': ExecutionParameter(type=Dict[Text, Any],
                                            optional=True),
    }
    INPUTS = {
        'transformed_examples': ChannelParameter(type_name='ExamplesPath'),
        'transform_output': ChannelParameter(type_name='TransformPath'),
        'schema': ChannelParameter(type_name='SchemaPath'),
    }
    OUTPUTS = {'output': ChannelParameter(type_name='ModelExportPath')}
Exemplo n.º 8
0
class TransformSpec(base_component.ComponentSpec):
    """Transform component spec."""

    PARAMETERS = {
        'module_file': ExecutionParameter(type=(str, Text), optional=True),
        'preprocessing_fn': ExecutionParameter(type=(str, Text),
                                               optional=True),
    }
    INPUTS = {
        'input_data': ChannelParameter(type=standard_artifacts.Examples),
        'schema': ChannelParameter(type=standard_artifacts.Schema),
    }
    OUTPUTS = {
        'transform_output':
        ChannelParameter(type=standard_artifacts.TransformResult),
        'transformed_examples':
        ChannelParameter(type=standard_artifacts.Examples),
    }
Exemplo n.º 9
0
class CustomHeadComponentSpec(base_component.ComponentSpec):
    """Example for a ComponentSpec of a Custom TFX Head Component."""

    COMPONENT_NAME = 'Custom_Head_Component'
    PARAMETERS = {
        'string_execution_parameter': ExecutionParameter(type=Text),
        'integer_execution_parameter': ExecutionParameter(type=int),

        # don't change these two:
        'input_config': ExecutionParameter(type=example_gen_pb2.Input),
        'output_config': ExecutionParameter(type=example_gen_pb2.Output)
    }
    INPUTS = {
        'input_example': ChannelParameter(type_name='RandomTypeNameForInput')
    }
    OUTPUTS = {
        'output_example': ChannelParameter(type_name='RandomTypeNameForOutput')
    }
Exemplo n.º 10
0
class TrainerSpec(base_component.ComponentSpec):
    """Trainer component spec."""

    PARAMETERS = {
        'train_args': ExecutionParameter(type=trainer_pb2.TrainArgs),
        'eval_args': ExecutionParameter(type=trainer_pb2.EvalArgs),
        'module_file': ExecutionParameter(type=(str, Text), optional=True),
        'trainer_fn': ExecutionParameter(type=(str, Text), optional=True),
        'custom_config': ExecutionParameter(type=Dict[Text, Any],
                                            optional=True),
    }
    INPUTS = {
        'examples':
        ChannelParameter(type=standard_artifacts.Examples),
        'transform_output':
        ChannelParameter(type=standard_artifacts.TransformResult,
                         optional=True),
        'schema':
        ChannelParameter(type=standard_artifacts.Schema),
    }
    OUTPUTS = {'output': ChannelParameter(type=standard_artifacts.Model)}
Exemplo n.º 11
0
class ModelValidatorSpec(base_component.ComponentSpec):
  """ModelValidator component spec."""

  PARAMETERS = {
      'component_unique_name': ExecutionParameter(type=str),
  }
  INPUTS = {
      'examples': ChannelParameter(type_name='ExamplesPath'),
      'model': ChannelParameter(type_name='ModelExportPath'),
  }
  OUTPUTS = {
      'blessing': ChannelParameter(type_name='ModelBlessingPath'),
  }
Exemplo n.º 12
0
class TransformSpec(base_component.ComponentSpec):
    """Transform component spec."""

    PARAMETERS = {
        'module_file': ExecutionParameter(type=(str, Text)),
    }
    INPUTS = {
        'input_data': ChannelParameter(type_name='ExamplesPath'),
        'schema': ChannelParameter(type_name='SchemaPath'),
    }
    OUTPUTS = {
        'transform_output': ChannelParameter(type_name='TransformPath'),
        'transformed_examples': ChannelParameter(type_name='ExamplesPath'),
    }
Exemplo n.º 13
0
class EvaluatorSpec(base_component.ComponentSpec):
  """Evaluator component spec."""

  PARAMETERS = {
      'feature_slicing_spec': ExecutionParameter(
          type=evaluator_pb2.FeatureSlicingSpec),
  }
  INPUTS = {
      'examples': ChannelParameter(type=standard_artifacts.Examples),
      'model_exports': ChannelParameter(type=standard_artifacts.Model),
  }
  OUTPUTS = {
      'output': ChannelParameter(type=standard_artifacts.ModelEvalResult),
  }
Exemplo n.º 14
0
class EvaluatorSpec(base_component.ComponentSpec):
    """Evaluator component spec."""

    PARAMETERS = {
        'feature_slicing_spec':
        ExecutionParameter(type=evaluator_pb2.FeatureSlicingSpec),
    }
    INPUTS = {
        'examples': ChannelParameter(type_name='ExamplesPath'),
        'model_exports': ChannelParameter(type_name='ModelExportPath'),
    }
    OUTPUTS = {
        'output': ChannelParameter(type_name='ModelEvalPath'),
    }
Exemplo n.º 15
0
 class WrongTypeComponentSpecC(base_component.ComponentSpec):
     COMPONENT_NAME = 'WrongTypeComponentC'
     PARAMETERS = {}
     INPUTS = {'x': ExecutionParameter(type=int)}
     OUTPUTS = {}
Exemplo n.º 16
0
 class DuplicatePropertyComponentSpec(base_component.ComponentSpec):
     PARAMETERS = {'x': ExecutionParameter(type=int)}
     INPUTS = {'x': ChannelParameter(type_name='X')}
     OUTPUTS = {}
Exemplo n.º 17
0
 class WrongTypeComponentSpecD(base_component.ComponentSpec):
     PARAMETERS = {}
     INPUTS = {'x': ExecutionParameter(type=int)}
     OUTPUTS = {}