|
| template<pRC::Operator::Transform OT = pRC::Operator::Transform::None, class T , class X , pRC::Size D, class RX = pRC::RemoveConstReference<X>> |
| X | jacobi (nonTT::MHNOperator< T, D > const &op, X const &b) |
| | Solves the linear system (1-Q)x=b or (1-Q)^Tx=b.
|
| |
| template<class T , pRC::Size D, class S > |
| std::tuple< pRC::Tensor< T, D, D >, std::map< std::string, std::string >, std::map< std::string, double > > | learnTheta (pRC::Tensor< T, D, D > const &theta, std::string const &header, std::string const &output, std::map< S, T > const &pD, cMHN::Score< T > const &Score, cMHN::Regulator< T, D > const &Regulator, T const &toleranceOptimizer, T const &toleranceSolverQ) |
| | Optimizes an MHN represented by a theta matrix to best describe a given data distribution.
|
| |
template<pRC::Operator::Transform OT = pRC::Operator::Transform::None, pRC::Operator::Restrict OR = pRC::Operator::Restrict::None, pRC::Operator::Hint OH = pRC::Operator::Hint::None, class T1 , pRC::Size D, class T2 , pRC::Size... Ns>
requires (OR == pRC::Operator::Restrict::None) && (OT == pRC::Operator::Transform::None) |
| static constexpr auto | applyDerivative (MHNOperator< T1, D > const &op, pRC::Tensor< T2, Ns... > const &x, pRC::Index const &i) |
| | apply the derivative of an MHN Q wrt to theta_ii to a vector x
|
| |
template<pRC::Operator::Transform OT = pRC::Operator::Transform::None, pRC::Operator::Restrict OR = pRC::Operator::Restrict::None, pRC::Operator::Hint OH = pRC::Operator::Hint::None, class T1 , pRC::Size D, class T2 , pRC::Size... Ns>
requires (OR == pRC::Operator::Restrict::None) |
| static constexpr auto | apply_diag (MHNOperator< T1, D > const &op, pRC::Tensor< T2, Ns... > const &x) |
| | apply the diagonal part of (1-Q) to a vector x, given an MHN Q
|
| |
template<pRC::Operator::Transform OT = pRC::Operator::Transform::None, pRC::Operator::Restrict OR = pRC::Operator::Restrict::None, pRC::Operator::Hint OH = pRC::Operator::Hint::None, class T1 , pRC::Size D, class T2 , pRC::Size... Ns>
requires (OR == pRC::Operator::Restrict::None) |
| static constexpr auto | apply_offdiag (MHNOperator< T1, D > const &op, pRC::Tensor< T2, Ns... > const &x) |
| | apply the off-diagonal part of Q or its transposed to a vector x, given an MHN Q
|
| |
template<pRC::Operator::Transform OT = pRC::Operator::Transform::None, pRC::Operator::Restrict OR = pRC::Operator::Restrict::None, pRC::Operator::Hint OH = pRC::Operator::Hint::None, class T1 , pRC::Size D, class T2 , pRC::Size... Ns>
requires (OR == pRC::Operator::Restrict::None) |
| static constexpr auto | apply (MHNOperator< T1, D > const &op, pRC::Tensor< T2, Ns... > const &x) |
| | apply (1-Q) or its transposed to a vector x, given an MHN Q
|
| |
| std::tuple< pRC::Tensor< T, D, D >, std::map< std::string, std::string >, std::map< std::string, double > > cMHN::nonTT::learnTheta |
( |
pRC::Tensor< T, D, D > const & | theta, |
|
|
std::string const & | header, |
|
|
std::string const & | output, |
|
|
std::map< S, T > const & | pD, |
|
|
cMHN::Score< T > const & | Score, |
|
|
cMHN::Regulator< T, D > const & | Regulator, |
|
|
T const & | toleranceOptimizer, |
|
|
T const & | toleranceSolverQ ) |
Optimizes an MHN represented by a theta matrix to best describe a given data distribution.
The optimization is done by LBFGS. Logging information containing Score and Regulator names, Iteration number, Time, Score and Regularization strength is written to file after every iteration.
The optimized theta is returned. Additionally, two std::maps are returned containing logging information:
- std::map<std::string, std::string> logInfoNames: Info like Score name and Regulator name
- std::map<std::string, double> logInfoNumbers: Info like final score and runtime
- Template Parameters
-
| T | type used for calculations (inferred) |
| D | number of events of the dataset (inferred) |
| S | Subscripts type used as keys in data distribution (inferred) |
- Parameters
-
| theta | theta matrix representing the initial MHN |
| header | header of the data (usually containing event names) |
| output | file to write the theta matrix to |
| pD | data distribution to learn |
| Score | Score object representing the score used |
| Regulator | Regulator object representing the regulator used |
| toleranceOptimizer | tolerance of the optimizer |
| toleranceSolverQ | tolerance of the solver for calculating q (intermediate result for calculating the derivatives) |