bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
torch_normal.h
Go to the documentation of this file.
1//
2// Created by alex on 7/26/25.
3//
4
5#ifndef TORCH_NORMAL_H
6#define TORCH_NORMAL_H
7
8#include "bitrl/base/bitrl_config.h"
9
10#ifdef USE_PYTORCH
11
14
15#include <torch/torch.h>
16
17namespace bitrl
18{
19namespace maths::stats
20{
25{
26
27 public:
33
38
42 ~TorchNormalDist() override = default;
43
50
54 torch_tensor_t entropy() const override;
55
59 torch_tensor_t mean() const { return mean_; }
60
64 torch_tensor_t std() const { return sd_; }
65
66 private:
67 torch_tensor_t mean_;
69
74 virtual torch_tensor_t sample(c10::ArrayRef<int64_t> /*sample_shape*/)
75 {
76 return torch_tensor_t();
77 }
78};
79} // namespace maths::stats
80} // namespace bitrl
81
82#endif
83
84#endif // TORCH_NORMAL_H
TorchNormalDist(torch_tensor_t mu, torch_tensor_t sigma)
Default constructor.
~TorchNormalDist() override=default
~TorchCategorical. Destructor
torch_tensor_t std() const
Returns the standard deviation.
Definition torch_normal.h:64
torch_tensor_t entropy() const override
Compute the entropy.
torch_tensor_t sample() const
get a sample from the distribution
torch_tensor_t log_prob(torch_tensor_t value) override
log_prob
torch_tensor_t mean() const
Returns the mean.
Definition torch_normal.h:59
Definition torch_bernoulli_dist.h:23
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