tfp.experimental.tangent_spaces.GeneralSpace
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Arbitrary tangent space when no more-efficient special case applies.
Inherits From: TangentSpace
tfp.experimental.tangent_spaces.GeneralSpace(
basis, computed_log_volume=None
)
Args |
basis
|
Basis object representing a basis of shape
[N, B1, ..., Bk, D1, ... Dl] , where N is the
number of bases vectors, Bi are batch dimensions and Di refer to
the dimensions that this basis lives in.
|
computed_log_volume
|
Optional Tensor of shape [B1, ..., Bk] . Computed
log-volume coefficient.
Default None .
|
Methods
View source
transform_coordinatewise(
x, f, **kwargs
)
Same as transform_dimension_preserving
, for a coordinatewise f.
Default falls back to transform_dimension_preserving
, which may
be overridden in subclasses.
Args |
x
|
same as in transform_dimension_preserving .
|
f
|
same as in transform_dimension_preserving .
|
**kwargs
|
same as in transform_dimension_preserving .
|
Returns |
log_density
|
A Tensor representing the log density correction of f at x
|
space
|
A TangentSpace representing the tangent to fM at f(x)
|
Raises |
NotImplementedError
|
if the TangentSpace subclass does not implement
transform_dimension_preserving .
|
View source
transform_dimension_preserving(
x, f, **kwargs
)
Same as transform_general
, assuming f goes from R^n to R^n.
Default falls back to transform_general
, which may be overridden
in subclasses.
Args |
x
|
same as in transform_general .
|
f
|
same as in transform_general .
|
**kwargs
|
same as in transform_general .
|
Returns |
log_density
|
A Tensor representing the log density correction of f at x
|
space
|
A TangentSpace representing the tangent to fM at f(x)
|
Raises |
NotImplementedError
|
if the TangentSpace subclass does not implement
transform_general .
|
View source
transform_general(
x, f, **kwargs
)
Returns the density correction, in log space, corresponding to f at x.
Also returns a new TangentSpace
representing the tangent to fM at f(x).
Args |
x
|
Tensor (structure). The point at which to calculate the density.
|
f
|
Bijector or one of its subclasses. The transformation that requires a
density correction based on this tangent space.
|
**kwargs
|
Optional keyword arguments as part of the Bijector.
|
Returns |
log_density
|
A Tensor representing the log density correction of f at x
|
space
|
A TangentSpace representing the tangent to fM at f(x)
|
Raises |
NotImplementedError
|
if the TangentSpace subclass does not implement
this method.
|
View source
transform_projection(
x, f, **kwargs
)
Same as transform_general
, with f a projection (or its inverse).
Default falls back to transform_general
, which may be overridden
in subclasses.
Args |
x
|
same as in transform_general .
|
f
|
same as in transform_general .
|
**kwargs
|
same as in transform_general .
|
Returns |
log_density
|
A Tensor representing the log density correction of f at x
|
space
|
A TangentSpace representing the tangent to fM at f(x)
|
Raises |
NotImplementedError
|
if the TangentSpace subclass does not implement
transform_general .
|
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-11-21 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-11-21 UTC."],[],[],null,["# tfp.experimental.tangent_spaces.GeneralSpace\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/tangent_spaces/spaces.py#L372-L426) |\n\nArbitrary tangent space when no more-efficient special case applies.\n\nInherits From: [`TangentSpace`](../../../tfp/experimental/tangent_spaces/TangentSpace) \n\n tfp.experimental.tangent_spaces.GeneralSpace(\n basis, computed_log_volume=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `basis` | `Basis` object representing a basis of shape `[N, B1, ..., Bk, D1, ... Dl]`, where `N` is the number of bases vectors, `Bi` are batch dimensions and `Di` refer to the dimensions that this basis lives in. |\n| `computed_log_volume` | Optional `Tensor` of shape `[B1, ..., Bk]`. Computed log-volume coefficient. Default `None`. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `transform_coordinatewise`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/tangent_spaces/spaces.py#L172-L193) \n\n transform_coordinatewise(\n x, f, **kwargs\n )\n\nSame as `transform_dimension_preserving`, for a coordinatewise f.\n\nDefault falls back to `transform_dimension_preserving`, which may\nbe overridden in subclasses.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|----------------------------------------------|\n| `x` | same as in `transform_dimension_preserving`. |\n| `f` | same as in `transform_dimension_preserving`. |\n| `**kwargs` | same as in `transform_dimension_preserving`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------|--------------------------------------------------------------|\n| `log_density` | A `Tensor` representing the log density correction of f at x |\n| `space` | A `TangentSpace` representing the tangent to fM at f(x) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|-----------------------|-------------------------------------------------------------------------------------|\n| `NotImplementedError` | if the `TangentSpace` subclass does not implement `transform_dimension_preserving`. |\n\n\u003cbr /\u003e\n\n### `transform_dimension_preserving`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/tangent_spaces/spaces.py#L123-L143) \n\n transform_dimension_preserving(\n x, f, **kwargs\n )\n\nSame as `transform_general`, assuming f goes from R\\^n to R\\^n.\n\nDefault falls back to `transform_general`, which may be overridden\nin subclasses.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|---------------------------------|\n| `x` | same as in `transform_general`. |\n| `f` | same as in `transform_general`. |\n| `**kwargs` | same as in `transform_general`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------|--------------------------------------------------------------|\n| `log_density` | A `Tensor` representing the log density correction of f at x |\n| `space` | A `TangentSpace` representing the tangent to fM at f(x) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|-----------------------|------------------------------------------------------------------------|\n| `NotImplementedError` | if the `TangentSpace` subclass does not implement `transform_general`. |\n\n\u003cbr /\u003e\n\n### `transform_general`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/tangent_spaces/spaces.py#L98-L118) \n\n transform_general(\n x, f, **kwargs\n )\n\nReturns the density correction, in log space, corresponding to f at x.\n\nAlso returns a new `TangentSpace` representing the tangent to fM at f(x).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|-------------------------------------------------------------------------------------------------------------------------|\n| `x` | `Tensor` (structure). The point at which to calculate the density. |\n| `f` | `Bijector` or one of its subclasses. The transformation that requires a density correction based on this tangent space. |\n| `**kwargs` | Optional keyword arguments as part of the Bijector. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------|--------------------------------------------------------------|\n| `log_density` | A `Tensor` representing the log density correction of f at x |\n| `space` | A `TangentSpace` representing the tangent to fM at f(x) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|-----------------------|----------------------------------------------------------------|\n| `NotImplementedError` | if the `TangentSpace` subclass does not implement this method. |\n\n\u003cbr /\u003e\n\n### `transform_projection`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/tangent_spaces/spaces.py#L148-L167) \n\n transform_projection(\n x, f, **kwargs\n )\n\nSame as `transform_general`, with f a projection (or its inverse).\n\nDefault falls back to `transform_general`, which may be overridden\nin subclasses.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|---------------------------------|\n| `x` | same as in `transform_general`. |\n| `f` | same as in `transform_general`. |\n| `**kwargs` | same as in `transform_general`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------|--------------------------------------------------------------|\n| `log_density` | A `Tensor` representing the log density correction of f at x |\n| `space` | A `TangentSpace` representing the tangent to fM at f(x) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|-----------------------|------------------------------------------------------------------------|\n| `NotImplementedError` | if the `TangentSpace` subclass does not implement `transform_general`. |\n\n\u003cbr /\u003e"]]