This uses the real-input discrete Fourier transform (RDFT) of a kernel as
its parameterization. The inverse RDFT is applied to the variable to produce
the kernel.
tf.Tensor or None. The initial value of the kernel. If
not provided, its shape must be given, and the initial value of the
parameter will be undefined.
name
String. The name of the kernel.
shape
tf.TensorShape or compatible. Ignored unless initial_value is
None.
dtype
tf.dtypes.DType or compatible. DType of this parameter. If not
given, inferred from initial_value.
[[["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 2024-04-26 UTC."],[],[],null,["# tfc.layers.RDFTParameter\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/compression/blob/v2.14.1/tensorflow_compression/python/layers/parameters.py#L70-L182) |\n\nRDFT reparameterization of a convolution kernel.\n\nInherits From: [`Parameter`](../../tfc/layers/Parameter)\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tfc.RDFTParameter`](https://www.tensorflow.org/api_docs/python/tfc/layers/RDFTParameter)\n\n\u003cbr /\u003e\n\n tfc.layers.RDFTParameter(\n initial_value, name=None, shape=None, dtype=None\n )\n\nThis uses the real-input discrete Fourier transform (RDFT) of a kernel as\nits parameterization. The inverse RDFT is applied to the variable to produce\nthe kernel.\n\n(see \u003chttps://en.wikipedia.org/wiki/Discrete_Fourier_transform\u003e)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `initial_value` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) or `None`. The initial value of the kernel. If not provided, its `shape` must be given, and the initial value of the parameter will be undefined. |\n| `name` | String. The name of the kernel. |\n| `shape` | [`tf.TensorShape`](https://www.tensorflow.org/api_docs/python/tf/TensorShape) or compatible. Ignored unless `initial_value is None`. |\n| `dtype` | [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) or compatible. DType of this parameter. If not given, inferred from `initial_value`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `shape` | [`tf.TensorShape`](https://www.tensorflow.org/api_docs/python/tf/TensorShape). The shape of the convolution kernel. |\n| `real` | [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable). The real part of the RDFT of the kernel. |\n| `imag` | [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable). The imaginary part of the RDFT of the kernel. |\n| `dtype` | \u003cbr /\u003e \u003cbr /\u003e |\n| `name` | Returns the name of this module as passed or determined in the ctor. \u003cbr /\u003e | **Note:** This is not the same as the `self.name_scope.name` which includes parent module names. |\n| `name_scope` | Returns a [`tf.name_scope`](https://www.tensorflow.org/api_docs/python/tf/name_scope) instance for this class. |\n| `non_trainable_variables` | Sequence of non-trainable variables owned by this module and its submodules.**Note:** this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don't expect the return value to change. |\n| `submodules` | Sequence of all sub-modules. Submodules are modules which are properties of this module, or found as properties of modules which are properties of this module (and so on). a = tf.Module() b = tf.Module() c = tf.Module() a.b = b b.c = c list(a.submodules) == [b, c] True list(b.submodules) == [c] True list(c.submodules) == [] True \u003cbr /\u003e |\n| `trainable_variables` | Sequence of trainable variables owned by this module and its submodules. \u003cbr /\u003e | **Note:** this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don't expect the return value to change. |\n| `variables` | Sequence of variables owned by this module and its submodules.**Note:** this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don't expect the return value to change. |\n\nMethods\n-------\n\n### `get_config`\n\n[View source](https://github.com/tensorflow/compression/blob/v2.14.1/tensorflow_compression/python/layers/parameters.py#L175-L182) \n\n get_config() -\u003e Dict[str, Any]\n\nReturns the configuration of the `Parameter`.\n\n### `get_weights`\n\n[View source](https://github.com/tensorflow/compression/blob/v2.14.1/tensorflow_compression/python/layers/parameters.py#L47-L48) \n\n get_weights()\n\n### `set_weights`\n\n[View source](https://github.com/tensorflow/compression/blob/v2.14.1/tensorflow_compression/python/layers/parameters.py#L50-L55) \n\n set_weights(\n weights\n )\n\n### `with_name_scope`\n\n @classmethod\n with_name_scope(\n method\n )\n\nDecorator to automatically enter the module name scope. \n\n class MyModule(tf.Module):\n @tf.Module.with_name_scope\n def __call__(self, x):\n if not hasattr(self, 'w'):\n self.w = tf.Variable(tf.random.normal([x.shape[1], 3]))\n return tf.matmul(x, self.w)\n\nUsing the above module would produce [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable)s and [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor)s whose\nnames included the module name: \n\n mod = MyModule()\n mod(tf.ones([1, 2]))\n \u003ctf.Tensor: shape=(1, 3), dtype=float32, numpy=..., dtype=float32)\u003e\n mod.w\n \u003ctf.Variable 'my_module/Variable:0' shape=(2, 3) dtype=float32,\n numpy=..., dtype=float32)\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------|---------------------|\n| `method` | The method to wrap. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| The original method wrapped such that it enters the module's name scope. ||\n\n\u003cbr /\u003e\n\n### `__call__`\n\n[View source](https://github.com/tensorflow/compression/blob/v2.14.1/tensorflow_compression/python/layers/parameters.py#L144-L173) \n\n __call__(\n compute_dtype=None\n ) -\u003e tf.Tensor\n\nComputes and returns the convolution kernel as a [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor)."]]