1#ifndef TORCH_BERNOULLI_DIST_H
2#define TORCH_BERNOULLI_DIST_H
9#include "bitrl/base/bitrl_config.h"
16#include <torch/torch.h>
virtual torch_tensor_t sample(c10::ArrayRef< int64_t > sample_shape={}) override
Ssample. Sample from the distribution.
void build_from_probabilities(torch_tensor_t probs)
build the distribution from probabilities
virtual torch_tensor_t entropy() const override
entropy
torch_tensor_t get_logits() const
get_logits
Definition torch_bernoulli_dist.h:82
virtual torch_tensor_t log_prob(torch_tensor_t value) override
log_prob
TorchBernoulliDist()=default
Default constructor.
TorchBernoulliDist(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...
torch_tensor_t get_probs() const
get_probs
Definition torch_bernoulli_dist.h:88
void build_from_logits(torch_tensor_t logits)
build the distribution form logits
virtual ~TorchBernoulliDist()=default
~TorchCategorical. Destructor
TorchDistributionBase()=default
Constructor.
Definition torch_bernoulli_dist.h:23
Definition lp_metric.h:10
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
torch::Tensor torch_tensor_t
torch_tensor_t
Definition bitrl_types.h:95