56 template < GUM_Numeric GUM_SCALAR >
58 GUM_SCALAR default_weight) :
64 template < GUM_Numeric GUM_SCALAR >
71 template < GUM_Numeric GUM_SCALAR >
79 template < GUM_Numeric GUM_SCALAR >
84 template < GUM_Numeric GUM_SCALAR >
90 if (i.
val(C) > 1)
return (GUM_SCALAR)0.0;
94 for (
Idx j = 1; j < this->
nbrDim(); j++) {
99 fact = 1 / (1 + std::exp(-fact));
100 auto res = (i.
val(C) == 1) ? fact : (GUM_SCALAR)1.0 - fact;
105 template < GUM_Numeric GUM_SCALAR >
110 for (
Idx i = 1; i < this->
nbrDim(); i++) {
113 if (c != GUM_SCALAR(0)) {
128 template < GUM_Numeric GUM_SCALAR >
133 template < GUM_Numeric GUM_SCALAR >
139 template < GUM_Numeric GUM_SCALAR >
141 static const std::string str =
"MultiDimLogit";
Set of pairs of elements with fast search for both elements.
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
Idx val(Idx i) const
Returns the current value of the variable at position i.
GUM_SCALAR _external_weight_
MultiDimICIModel(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 1.0)
GUM_SCALAR externalWeight() const
GUM_SCALAR _default_weight_
GUM_SCALAR causalWeight(const DiscreteVariable &v) const
const DiscreteVariable & variable(Idx i) const override
Idx nbrDim() const override
MultiDimLogit(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 0.0)
Default constructor.
const std::string & name() const override
Returns the real name of the multiDimArray.
~MultiDimLogit() override
Destructor.
std::string toString() const override
Returns the real name of the multiDimArray.
MultiDimContainer< GUM_SCALAR > * newFactory() const override
This method creates a clone of this object, withouth its content (including variable),...
GUM_SCALAR get(const Instantiation &i) const override
Returns the real name of the multiDimArray.
Exception : operation not allowed.
#define GUM_ERROR(type, msg)
Size Idx
Type for indexes.
Headers of gum::MultiDimImplementation.
class for LOGIT implementation as multiDim
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree