Checkpointing - pwollstadt/IDTxl GitHub Wiki
IDTxl allows to write checkpoints and resume an analysis at a later point for the following algorithms:
- Network inference
BivariateMI()MultivariateMI()BivariateTE()MultivariateTE()
- Node dynamics
ActiveInformationStorage()
Write checkpoint
To enable checkpointing, set write_ckp to True in the settings dictionary
and provide a filename (the default is to write files with the prefix
idtxl_checkpoint into the current directory).
filename = './my_checkpoint'
settings = {'write_ckp': True,
'filename_ckp': filename}
IDTxl will save settings and raw input data used once at the beginning of an analysis. The toolbox will write an initial checkpoint file, which gets updated during the analysis, every time a variable is selected. The checkpoint records the current state of the analysis
'./my_checkpoint.ckp' # checkpoint
'./my_checkpoint.json' # settings
'./my_checkpoint.dat' # input data
Resume analysis from checkpoint
In case of failure, the analysis can be resumed from the last written checkpoint.
network_analysis = MultivariateTE()
data, settings, targets, sources = network_analysis.resume_checkpoint(
file_path)
results = network_analysis.analyse_network(
settings=settings, data=data, targets=targets, sources=sources)