bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
loss_type.h
Go to the documentation of this file.
1#ifndef LOSS_TYPE_H
2#define LOSS_TYPE_H
3
4#include <string>
5
6namespace bitrl
7{
8namespace utils
9{
10
14enum class LossType : char
15{
19};
20
26inline std::string to_string(LossType type)
27{
28 switch (type)
29 {
31 return "CROSS_ENTROPY";
32 case LossType::MSE:
33 return "MSE";
35 return "INVALID_TYPE";
36 }
37 return "INVALID_TYPE";
38}
39
43inline constexpr bool compare(LossType tp1, LossType tp2) { return tp1 == tp2; }
44
45} // namespace utils
46} // namespace bitrl
47
48#endif // LOSS_TYPE_H
Definition bitrl_concepts.h:22
std::string to_string(LossType type)
to_string. Returns the name of the given LossType
Definition loss_type.h:26
LossType
The loss functions a model can be trained with.
Definition loss_type.h:15
@ CROSS_ENTROPY
Definition loss_type.h:17
@ INVALID_TYPE
Definition loss_type.h:16
@ MSE
Definition loss_type.h:18
constexpr bool compare(LossType tp1, LossType tp2)
compare. Returns true when the two types are the same
Definition loss_type.h:43
Various utilities used when working with RL problems.
Definition bitrl_log.h:25