Model_Checker

src.Model_Checker.is_edge_tpu_compatible(model)[source]

Checks if a given Keras model is compatible with Edge TPU.

Parameters:

modeltensorflow.python.keras.engine.functional.Functional

The Keras model to be checked for Edge TPU compatibility.

Returns:

bool

True if the model is compatible with Edge TPU, False otherwise.

src.Model_Checker.model_has_attention(model)[source]

Checks if a given model contains multi head attention layers and whether they meet certain conditions.

Parameters:

modeltensorflow.python.keras.engine.functional.Functional

The Keras model to be checked for multi head attention layers.

Returns:

bool

True if the model contains multi head attention layers and all these layers output shapes are less than or equal to 256, False otherwise.

src.Model_Checker.model_has_problem(model)[source]

Checks if a given model contains any issues related to multi head attention layers and Edge TPU compatibility.

Parameters:

modeltensorflow.python.keras.engine.functional.Functional

The Keras model to be checked.

Returns:

bool

True if the model has an issue, False otherwise.