ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

Module: tfma.model_util

Utils for working with models.


class BatchReducibleBatchedDoFnWithModels: Abstract class for DoFns that need the shared models.

class BatchReducibleDoFnWithModels: Abstract class for DoFns that need the shared models.

class CombineFnWithModels: Abstract class for CombineFns that need the shared models.

class DoFnWithModels: Abstract class for DoFns that need the shared models.

class ModelContents: Class for storing model contents.

class ModelSignaturesDoFn: Updates extracts by calling specified model signature functions.


filter_by_input_names(...): Filters dict by input names.

find_input_name_in_features(...): Maps input name to an entry in features. Returns None if not found.

get_baseline_model_spec(...): Returns baseline model spec.

get_callable(...): Returns callable associated with given signature or None if not callable.

get_default_signature_name(...): Returns default signature name for given model.

get_feature_values_for_model_spec_field(...): Gets feature values associated with given model spec fields from extracts.

get_input_specs(...): Returns the input names and tensor specs associated with callable or None.

get_inputs(...): Returns inputs from record batch for given input specs.

get_label_key(...): Returns the label_key corresponding to a given output name.

get_model_spec(...): Returns model spec with given model name.

get_model_type(...): Returns model type for given model spec taking into account defaults.

get_non_baseline_model_specs(...): Returns non-baseline model specs.

get_preprocessing_signature(...): Returns the preprocessing function name and its feature name.

has_rubber_stamp(...): Check whether the candidate model is being rubber stamped.

input_specs_to_tensor_representations(...): Converts input specs into tensor representations.

is_callable_fn(...): Returns true if function is callable.

model_construct_fn(...): Returns function for constructing shared models.

verify_and_update_eval_shared_models(...): Verifies eval shared models and normnalizes to produce a single list.