tf.keras.constraints.RadialConstraint
Stay organized with collections
Save and categorize content based on your preferences.
Constrains Conv2D
kernel weights to be the same for each radius.
Inherits From: Constraint
For example, the desired output for the following 4-by-4 kernel::
kernel = [[v_00, v_01, v_02, v_03],
[v_10, v_11, v_12, v_13],
[v_20, v_21, v_22, v_23],
[v_30, v_31, v_32, v_33]]
is this::
kernel = [[v_11, v_11, v_11, v_11],
[v_11, v_33, v_33, v_11],
[v_11, v_33, v_33, v_11],
[v_11, v_11, v_11, v_11]]
This constraint can be applied to any Conv2D
layer version, including
Conv2DTranspose
and SeparableConv2D
, and with either "channels_last"
or
"channels_first"
data format. The method assumes the weight tensor is of
shape (rows, cols, input_depth, output_depth)
.
Methods
get_config
View source
get_config()
__call__
View source
__call__(
w
)
Call self as a function.
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 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.constraints.RadialConstraint\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/constraints/RadialConstraint) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/constraints.py#L176-L249) |\n\nConstrains `Conv2D` kernel weights to be the same for each radius.\n\nInherits From: [`Constraint`](../../../tf/keras/constraints/Constraint)\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.keras.constraints.radial_constraint`](/api_docs/python/tf/keras/constraints/RadialConstraint)\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.constraints.RadialConstraint`](/api_docs/python/tf/keras/constraints/RadialConstraint), [`tf.compat.v1.keras.constraints.radial_constraint`](/api_docs/python/tf/keras/constraints/RadialConstraint), \\`tf.compat.v2.keras.constraints.RadialConstraint\\`, \\`tf.compat.v2.keras.constraints.radial_constraint\\`\n\n\u003cbr /\u003e\n\nFor example, the desired output for the following 4-by-4 kernel:: \n\n kernel = [[v_00, v_01, v_02, v_03],\n [v_10, v_11, v_12, v_13],\n [v_20, v_21, v_22, v_23],\n [v_30, v_31, v_32, v_33]]\n\nis this:: \n\n kernel = [[v_11, v_11, v_11, v_11],\n [v_11, v_33, v_33, v_11],\n [v_11, v_33, v_33, v_11],\n [v_11, v_11, v_11, v_11]]\n\nThis constraint can be applied to any `Conv2D` layer version, including\n`Conv2DTranspose` and `SeparableConv2D`, and with either `\"channels_last\"` or\n`\"channels_first\"` data format. The method assumes the weight tensor is of\nshape `(rows, cols, input_depth, output_depth)`.\n\nMethods\n-------\n\n### `get_config`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/constraints.py#L40-L41) \n\n get_config()\n\n### `__call__`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/constraints.py#L203-L217) \n\n __call__(\n w\n )\n\nCall self as a function."]]