|
cMHN 1.2
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 minimizes the compilation time needed. 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):
Also note that precompiled object files are split into files involved in TT calculations (filename starts with TT_) and files without the TT format (filename starts with nonTT_). When nothing is specified, both are files are compiled if they do not exist yet. If only one of the cases is needed, it is therefore better to only compile the corresponding object file. This is possible by specifying the build target nontt or tt in the make command, like such:
For the nonTT case, the compilation time grows exponentially with the number of events, so it is highly discouraged to use it for >20 events.