tfg.geometry.convolution.graph_pooling.unpool
Stay organized with collections
Save and categorize content based on your preferences.
Graph upsampling by inverting the pooling map.
tfg.geometry.convolution.graph_pooling.unpool(
data: type_alias.TensorLike,
pool_map: type_alias.TensorLike,
sizes: type_alias.TensorLike,
name: str = 'graph_pooling_unpool'
) -> tf.Tensor
Upsamples a graph by applying a pooling map in reverse. The inputs pool_map
and sizes
are the same as used for pooling:
pooled = pool(data, pool_map, sizes)
upsampled = unpool(pooled, pool_map, sizes)
The shorthands used below are
V1
: The number of vertices in the input data.
V2
: The number of vertices in the unpooled output data.
C
: The number of channels in the data.
Note |
In the following, A1 to A3 are optional batch dimensions. Only up to three
batch dimensions are supported due to limitations with TensorFlow's
dense-sparse multiplication.
|
Please see the documentation for graph_pooling.pool
for a detailed
interpretation of the inputs pool_map
and sizes
.
Args |
data
|
A float tensor with shape [A1, ..., A3, V1, C] .
|
pool_map
|
A SparseTensor with the same type as data and with shape
[A1, ..., A3, V1, V2] . The features for vertex v1 are computed by
pooling over the entries in pool_map[A1, ..., A3, v1, :] . This function
applies this pooling map in reverse.
|
sizes
|
An int tensor of shape [A1, ..., A3, 2] indicating the true
input sizes in case of padding (sizes=None indicates no padding):
sizes[A1, ..., A3, 0] <= V1 and sizes[A1, ..., A3, 1] <= V2 .
|
name
|
A name for this op. Defaults to 'graph_pooling_unpool'.
|
Returns |
Tensor with shape [A1, ..., A3, V2, C] .
|
Raises |
TypeError
|
if the input types are invalid.
|
ValueError
|
if the input dimensions are invalid.
|
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 2022-10-28 UTC.
[null,null,["Last updated 2022-10-28 UTC."],[],[],null,["# tfg.geometry.convolution.graph_pooling.unpool\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/geometry/convolution/graph_pooling.py#L119-L185) |\n\nGraph upsampling by inverting the pooling map. \n\n tfg.geometry.convolution.graph_pooling.unpool(\n data: type_alias.TensorLike,\n pool_map: type_alias.TensorLike,\n sizes: type_alias.TensorLike,\n name: str = 'graph_pooling_unpool'\n ) -\u003e tf.Tensor\n\nUpsamples a graph by applying a pooling map in reverse. The inputs `pool_map`\nand `sizes` are the same as used for pooling: \n\n pooled = pool(data, pool_map, sizes)\n upsampled = unpool(pooled, pool_map, sizes)\n\nThe shorthands used below are\n`V1`: The number of vertices in the input data.\n`V2`: The number of vertices in the unpooled output data.\n`C`: The number of channels in the data.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Note ---- ||\n|---|---|\n| In the following, A1 to A3 are optional batch dimensions. Only up to three batch dimensions are supported due to limitations with TensorFlow's dense-sparse multiplication. ||\n\n\u003cbr /\u003e\n\nPlease see the documentation for [`graph_pooling.pool`](../../../../tfg/geometry/convolution/graph_pooling/pool) for a detailed\ninterpretation of the inputs `pool_map` and `sizes`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `data` | A `float` tensor with shape `[A1, ..., A3, V1, C]`. |\n| `pool_map` | A `SparseTensor` with the same type as `data` and with shape `[A1, ..., A3, V1, V2]`. The features for vertex [`v1`](https://www.tensorflow.org/api_docs/python/tf/compat/v1) are computed by pooling over the entries in `pool_map[A1, ..., A3, v1, :]`. This function applies this pooling map in reverse. |\n| `sizes` | An `int` tensor of shape `[A1, ..., A3, 2]` indicating the true input sizes in case of padding (`sizes=None` indicates no padding): `sizes[A1, ..., A3, 0] \u003c= V1` and `sizes[A1, ..., A3, 1] \u003c= V2`. |\n| `name` | A name for this op. Defaults to 'graph_pooling_unpool'. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Tensor with shape `[A1, ..., A3, V2, C]`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|--------------------------------------|\n| `TypeError` | if the input types are invalid. |\n| `ValueError` | if the input dimensions are invalid. |\n\n\u003cbr /\u003e"]]