Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindspore.nn.probability.bijector.Bijector

class mindspore.nn.probability.bijector.Bijector(is_constant_jacobian=False, is_injective=True, name=None, dtype=None, param=None)[source]

Bijecotr class. A bijector perform a mapping from one distribution to the other via some function. If X is a random variable following the original distribution, and g(x) is the mapping function, then Y=g(X) is the random variable following the transformed distribution.

Parameters
  • is_constant_jacobian (bool) – Whether the Bijector has constant derivative. Default: False .

  • is_injective (bool) – Whether the Bijector is a one-to-one mapping. Default: True .

  • name (str) – The name of the Bijector. Default: None .

  • dtype (mindspore.dtype) – The type of the distributions that the Bijector can operate on. Default: None .

  • param (dict) – The parameters used to initialize the Bijector. Default: None .

Note

dtype of bijector represents the type of the distributions that the bijector could operate on. When dtype is None, there is no enforcement on the type of input value except that the input value has to be float type. During initialization, when dtype is None, there is no enforcement on the dtype of the parameters. All parameters should have the same float type, otherwise a TypeError will be raised. Specifically, the parameter type will follow the dtype of the input value, i.e. parameters of the bijector will be casted into the same type as input value when dtype is None. When dtype is specified, it is forcing the parameters and input value to be the same dtype as dtype. When the type of parameters or the type of the input value is not the same as dtype, a TypeError will be raised. Only subtype of mindspore.float_type can be used to specify bijector's dtype.

Supported Platforms:

Ascend GPU

cast_param_by_value(value, para)[source]

Cast the parameter(s) of the bijector to be the same type of input_value.

Parameters
  • value (Tensor) – input value.

  • para (Tensor) – parameter(s) of the bijector.

Returns

Tensor, the value of parameters after casting.

construct(name, *args, **kwargs)[source]

Override construct in Cell.

Note

Names of supported functions include: 'forward', 'inverse', 'forward_log_jacobian', and 'inverse_log_jacobian'.

Parameters
  • name (str) – The name of the function.

  • *args (list) – the list of positional arguments forwarded to subclasses.

  • **kwargs (dict) – the dictionary of keyword arguments forwarded to subclasses.

Returns

Tensor, the result of the function corresponding to name.

forward(value, *args, **kwargs)[source]

Forward transformation: transform the input value to another distribution.

Parameters
  • value (Tensor) – the value of the input variables.

  • *args (list) – the list of positional arguments forwarded to subclasses.

  • **kwargs (dict) – the dictionary of keyword arguments forwarded to subclasses.

Returns

Tensor, the value of the transformed random variable.

forward_log_jacobian(value, *args, **kwargs)[source]

Logarithm of the derivative of the forward transformation.

Parameters
  • value (Tensor) – the value of the input variables.

  • *args (list) – the list of positional arguments forwarded to subclasses.

  • **kwargs (dict) – the dictionary of keyword arguments forwarded to subclasses.

Returns

Tensor, the value of logarithm of the derivative of the forward transformation.

inverse(value, *args, **kwargs)[source]

Inverse transformation: transform the input value back to the original distribution.

Parameters
  • value (Tensor) – the value of the transformed variables.

  • *args (list) – the list of positional arguments forwarded to subclasses.

  • **kwargs (dict) – the dictionary of keyword arguments forwarded to subclasses.

Returns

Tensor, the value of the input random variable.

inverse_log_jacobian(value, *args, **kwargs)[source]

Logarithm of the derivative of the inverse transformation.

Parameters
  • value (Tensor) – the value of the transformed variables.

  • *args (list) – the list of positional arguments forwarded to subclasses.

  • **kwargs (dict) – the dictionary of keyword arguments forwarded to subclasses.

Returns

Tensor, the value of logarithm of the derivative of the inverse transformation.