Esempio n. 1
0
 class _FakeComponentSpec(base_component.ComponentSpec):
     PARAMETERS = {}
     INPUTS = dict([(arg, ChannelParameter(type_name=channel.type_name))
                    for arg, channel in inputs.items()])
     OUTPUTS = dict([(arg, ChannelParameter(type_name=channel.type_name))
                     for arg, channel in outputs.items()] +
                    [('output', ChannelParameter(type_name=name))])
Esempio n. 2
0
class _FakeComponentSpecD(base_component.ComponentSpec):
  PARAMETERS = {}
  INPUTS = {
      'b': ChannelParameter(type_name='b'),
      'c': ChannelParameter(type_name='c'),
  }
  OUTPUTS = {'output': ChannelParameter(type_name='d')}
Esempio n. 3
0
class _FakeComponentSpecE(base_component.ComponentSpec):
    COMPONENT_NAME = 'component_e'
    PARAMETERS = {}
    INPUTS = {
        'a': ChannelParameter(type_name='a'),
        'b': ChannelParameter(type_name='b'),
        'd': ChannelParameter(type_name='d'),
    }
    OUTPUTS = {'output': ChannelParameter(type_name='e')}
Esempio n. 4
0
class SchemaGenSpec(base_component.ComponentSpec):
    """SchemaGen component spec."""

    PARAMETERS = {}
    INPUTS = {
        'stats': ChannelParameter(type=standard_artifacts.ExampleStatistics),
    }
    OUTPUTS = {
        'output': ChannelParameter(type=standard_artifacts.Schema),
    }
Esempio n. 5
0
class StatisticsGenSpec(base_component.ComponentSpec):
  """StatisticsGen component spec."""

  PARAMETERS = {}
  INPUTS = {
      'input_data': ChannelParameter(type_name='ExamplesPath'),
  }
  OUTPUTS = {
      'output': ChannelParameter(type_name='ExampleStatisticsPath'),
  }
Esempio n. 6
0
class SchemaGenSpec(base_component.ComponentSpec):
    """SchemaGen component spec."""

    PARAMETERS = {}
    INPUTS = {
        'stats': ChannelParameter(type_name='ExampleStatisticsPath'),
    }
    OUTPUTS = {
        'output': ChannelParameter(type_name='SchemaPath'),
    }
Esempio n. 7
0
class ExampleValidatorSpec(base_component.ComponentSpec):
    """ExampleValidator component spec."""

    PARAMETERS = {}
    INPUTS = {
        'stats': ChannelParameter(type_name='ExampleStatisticsPath'),
        'schema': ChannelParameter(type_name='SchemaPath'),
    }
    OUTPUTS = {
        'output': ChannelParameter(type_name='ExampleValidationPath'),
    }
Esempio n. 8
0
class ModelValidatorSpec(base_component.ComponentSpec):
    """ModelValidator component spec."""

    PARAMETERS = {}
    INPUTS = {
        'examples': ChannelParameter(type=standard_artifacts.Examples),
        'model': ChannelParameter(type=standard_artifacts.Model),
    }
    OUTPUTS = {
        'blessing': ChannelParameter(type=standard_artifacts.ModelBlessing),
    }
Esempio n. 9
0
class ModelValidatorSpec(base_component.ComponentSpec):
    """ModelValidator component spec."""

    COMPONENT_NAME = 'ModelValidator'
    PARAMETERS = {}
    INPUTS = {
        'examples': ChannelParameter(type_name='ExamplesPath'),
        'model': ChannelParameter(type_name='ModelExportPath'),
    }
    OUTPUTS = {
        'blessing': ChannelParameter(type_name='ModelBlessingPath'),
    }
Esempio n. 10
0
class ExampleValidatorSpec(base_component.ComponentSpec):
    """ExampleValidator component spec."""

    PARAMETERS = {}
    INPUTS = {
        'stats': ChannelParameter(type=standard_artifacts.ExampleStatistics),
        'schema': ChannelParameter(type=standard_artifacts.Schema),
    }
    OUTPUTS = {
        'output':
        ChannelParameter(type=standard_artifacts.ExampleValidationResult),
    }
Esempio n. 11
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'),
    }
Esempio n. 12
0
class FileBasedExampleGenSpec(base_component.ComponentSpec):
    """File-based ExampleGen component spec."""

    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'),
    }
Esempio n. 13
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'),
  }
Esempio n. 14
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),
  }
Esempio n. 15
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'),
    }
Esempio n. 16
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'),
    }
Esempio n. 17
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'),
    }
Esempio n. 18
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'),
    }
Esempio n. 19
0
 class SimpleComponentSpec(base_component.ComponentSpec):
     PARAMETERS = {
         'x': ExecutionParameter(type=int),
         'y': ExecutionParameter(type=int, optional=True),
     }
     INPUTS = {'z': ChannelParameter(type_name='Z')}
     OUTPUTS = {}
Esempio n. 20
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')}
Esempio n. 21
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')
    }
Esempio n. 22
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),
    }
Esempio n. 23
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)}
Esempio n. 24
0
class QueryBasedExampleGenSpec(base_component.ComponentSpec):
    """Query-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 = {}
    OUTPUTS = {
        'examples': ChannelParameter(type_name='ExamplesPath'),
    }
Esempio n. 25
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),
      'custom_config':
          ExecutionParameter(type=example_gen_pb2.CustomConfig, optional=True),
  }
  INPUTS = {}
  OUTPUTS = {
      'examples': ChannelParameter(type_name='ExamplesPath'),
  }
Esempio n. 26
0
class _FakeComponentSpecA(base_component.ComponentSpec):
    COMPONENT_NAME = 'component_a'
    PARAMETERS = {}
    INPUTS = {}
    OUTPUTS = {'output': ChannelParameter(type_name='a')}
Esempio n. 27
0
class _FakeComponentSpecC(base_component.ComponentSpec):
  PARAMETERS = {}
  INPUTS = {'a': ChannelParameter(type_name='a')}
  OUTPUTS = {'output': ChannelParameter(type_name='c')}
Esempio n. 28
0
 class DuplicatePropertyComponentSpec(base_component.ComponentSpec):
     PARAMETERS = {'x': ExecutionParameter(type=int)}
     INPUTS = {'x': ChannelParameter(type_name='X')}
     OUTPUTS = {}
Esempio n. 29
0
 class WrongTypeComponentSpecB(base_component.ComponentSpec):
     PARAMETERS = {'x': ChannelParameter(type_name='X')}
     INPUTS = {}
     OUTPUTS = {}