Save the date! Google I/O returns May 18-20 Register now

model_remediation.min_diff.keras.utils.validate_min_diff_structure

Validates that struct is a valid MinDiff structure.

struct Structure that will be validated.
struct_name Name of struct, used only for error messages.
element_type Type of elements. If None, types are not checked.

A struct is a valid MinDiff structure if it is either a single element (including tuples) or is an unnested dictionary (with string keys). If element_type is set, the function will also validate that all elements are of the correct type.

TypeError If struct is neither a single element (including a tuple) nor a dict.
ValueError If struct is a dict with non-string keys.
ValueError If struct is a dict with values that are not single elements (including tuples).