|
bitsim
Model, simulate, estimate and control robots in C++
|
#include <torch_categorical.h>


Public Member Functions | |
| TorchCategorical ()=default | |
| Default constructor. | |
| TorchCategorical (torch_tensor_t probs, bool do_build_from_logits=false) | |
| Build the categorical distribution from given torch_tensor_t of probabilities. if the flag build_from_logits, then the given tensor is assumed to represent logits. | |
| ~TorchCategorical () override=default | |
| ~TorchCategorical. Destructor | |
| virtual torch_tensor_t | entropy () const override |
| entropy | |
| virtual torch_tensor_t | log_prob (torch_tensor_t value) override |
| log_prob | |
| virtual torch_tensor_t | sample (c10::ArrayRef< int64_t > sample_shape={}) override |
| Ssample. Sample from the distribution. | |
| void | build_from_logits (torch_tensor_t logits) |
| build the distribution form logits | |
| void | build_from_probabilities (torch_tensor_t probs) |
| build the distribution from probabilities | |
| torch_tensor_t | get_logits () const |
| get_logits | |
| torch_tensor_t | get_probs () const |
| get_probs | |
| Public Member Functions inherited from bitrl::maths::stats::TorchDistributionBase | |
| virtual | ~TorchDistributionBase ()=default |
| Destructor. | |
| virtual torch_tensor_t | log_prob (torch_tensor_t value)=0 |
| log_prob | |
Additional Inherited Members | |
| Protected Member Functions inherited from bitrl::maths::stats::TorchDistributionBase | |
| TorchDistributionBase ()=default | |
| Constructor. | |
| std::vector< int64_t > | extended_shape (c10::ArrayRef< int64_t > sample_shape) |
| extended_shape | |
| Protected Attributes inherited from bitrl::maths::stats::TorchDistributionBase | |
| std::vector< int64_t > | batch_shape_ |
| batch_shape_ | |
| std::vector< int64_t > | event_shape_ |
| event_shape_ | |
Default constructor.
| bitrl::maths::stats::TorchCategorical::TorchCategorical | ( | torch_tensor_t | probs, |
| bool | do_build_from_logits = false ) |
Build the categorical distribution from given torch_tensor_t of probabilities. if the flag build_from_logits, then the given tensor is assumed to represent logits.
|
overridedefault |
~TorchCategorical. Destructor
build the distribution form logits
build the distribution from probabilities
|
overridevirtual |
|
inline |
get_logits
|
inline |
get_probs
|
overridevirtual |
log_prob
| value |
|
overridevirtual |
Ssample. Sample from the distribution.
Implements bitrl::maths::stats::TorchDistributionBase.