Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.specs.DistributionSpec

View source on GitHub

Describes a tfp.distribution.Distribution.

tf_agents.specs.DistributionSpec(
    builder, input_params_spec, sample_spec, **distribution_parameters
)

Args:

  • builder: Callable function(**params) which returns a Distribution following the spec.
  • input_params_spec: Nest of tensor_specs describing the tensor parameters required for building the described distribution.
  • sample_spec: Data type of the output samples of the described distribution.
  • **distribution_parameters: Extra parameters for building the distribution.

Attributes:

  • builder: Returns the distribution_builder of the spec.
  • distribution_parameters: Returns the distribution_parameters of the spec.
  • input_params_spec: Returns the input_params_spec of the spec.
  • sample_spec: Returns the sample_spec of the spec.

Methods

build_distribution

View source

build_distribution(
    **distribution_parameters
)

Creates an instance of the described distribution.

The spec's paramers are updated with the given ones. Args: **distribution_parameters: Kwargs update the spec's distribution parameters.

Returns:

Distribution instance.