tfmot.quantization.keras.graph_transformations.transforms.LayerPattern
Stay organized with collections
Save and categorize content based on your preferences.
Defines a tree sub-graph pattern of Keras layers to match in a model.
tfmot.quantization.keras.graph_transformations.transforms.LayerPattern(
class_name, config=None, inputs=None
)
LayerPattern
can be used to describe various common patterns in model
graphs that we need to find.
Examples |
Matches a Conv+BN+ReLU6 and DepthwiseConv+BN+ReLU6 pattern.
pattern = LayerPattern('ReLU', {'max_value': 6.0}, [
LayerPattern('BatchNormalization', {}, [
LayerPattern('Conv2D|DepthwiseConv2D', {} [])
])
])
Matches multiple Conv2Ds feeding into a Concat.
pattern = LayerPattern('Concat', {}, [
LayerPattern('Conv2D', {}, []),
LayerPattern('Conv2D', {}, [])
])
|
Args |
class_name
|
Type of keras layer (such as Conv2D, Dense etc.)
|
config
|
Map of arguments of the layer to match. For eg., for ReLU(6.0)
it would be {'max_value': 6.0}.
|
inputs
|
input layers to the layer.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-05-26 UTC."],[],[]]