|
cMHN 1.0
C++ library for learning MHNs with pRC
|
cMHN is a C++ library developed to make efficient calculations of Mutual Hazard Networks (MHNs) possible using only a few lines of code. Built on top of pRC, a library for handling high-dimensional tensors in the tensor train format, cMHN is highly performant, while still being easy to write.
For functionality of a certain feature of cMHN, check the respective function's or class' documentation. Some explanations and tutorials will be made available here when time allows.
cMHN comes with a smart compilation scheme to avoid redundand compilations. For this, the provided makefile is used. It is employed using a command like
Here, test.cpp and test.out are the source and target filenames. EVENTS denotes the number of genomic events used. MAXRANKP and MAXRANKQ are the maximum rank for the calculation of pTheta and q (from the gradient). When not using the Tensor Train format, MAXRANKP and MAXRANKQ can be omitted.
Each compilation process first checks if this combination of parameters (EVENTS, MAXRANKP and MAXRANKQ) has been compiled before. If not, it compiles the compile-time heavy parts of cMHN (and pRC) into object files stored in the folder precompiled. If this has already been done in a prior compilation process, this step is skipped and the object files, together with the provided source file, are compiled into the output file.
This procedure ensures minimal computation while allowing for the most flexibility. Since object files are stored for each new combination of parameters, it is a good idea to check the precompiled folder every once in a while and remove files that are no longer needed. For reference, the files are named according to the following scheme (with the corresponding numbers inserted in the curly braces):
It is also noted that precompiled object files are split into files involved in Tensor Train calculations (filename starts with TT_) and files without the Tensor Train format (filename starts with nonTT_). For EVENTS>24, only the TT file is created, since it is strongly discouraged to perform calculations without the Tensor Train format for this many events.