35 template <
typename GUM_SCALAR >
37 GUM_SCALAR default_weight) :
43 template <
typename GUM_SCALAR >
51 template <
typename GUM_SCALAR >
60 template <
typename GUM_SCALAR >
65 template <
typename GUM_SCALAR >
73 if (i.
val(C) > 1)
return (GUM_SCALAR)0.0;
77 for (
Idx j = 1; j < this->
nbrDim(); j++) {
83 fact = 1 / (1 + std::exp(-fact));
84 auto res = (i.
val(C) == 1) ? fact : (GUM_SCALAR)1.0 - fact;
89 template <
typename GUM_SCALAR >
94 for (
Idx i = 1; i < this->
nbrDim(); i++) {
97 if (c != GUM_SCALAR(0)) {
112 template <
typename GUM_SCALAR >
118 template <
typename GUM_SCALAR >
126 template <
typename GUM_SCALAR >
128 static const std::string str =
"MultiDimLogit";
virtual const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
virtual const std::string & name() const
Returns the real name of the multiDimArray.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Base class for discrete random variable.
virtual GUM_SCALAR get(const Instantiation &i) const
Returns the real name of the multiDimArray.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract base class for all multi dimensionnal containers.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const std::string toString() const
Returns the real name of the multiDimArray.
GUM_SCALAR __external_weight
in Henrion (89).
Idx val(Idx i) const
Returns the current value of the variable at position i.
GUM_SCALAR externalWeight() const
Copy of a multiDimICIModel.
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map's DAG in output using the Graphviz-dot format.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
abstract class for Conditional Indepency Models
GUM_SCALAR __default_weight
in Henrion (89) in a hashtable with a default_value.
Set of pairs of elements with fast search for both elements.
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Class for assigning/browsing values to tuples of discrete variables.
GUM_SCALAR causalWeight(const DiscreteVariable &v) const
Copy of a multiDimICIModel.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
This method creates a clone of this object, withouth its content (including variable), you must use this method if you want to ensure that the generated object has the same type than the object containing the called newFactory()
virtual ~MultiDimLogit()
Destructor.
Size Idx
Type for indexes.
#define GUM_ERROR(type, msg)
MultiDimLogit(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 0.0)
Default constructor.