Hint
Example code: https://github.com/cselab/korali/tree/master/examples/features/save.results/
Preserving Results
In this tutorial we show how Korali can be used to store important outputs from the computational model that otherwise would be lost after evaluation.
Computational Model
In the model we assign quantity of interest (QoI) to the Korali Sample:
# Store QoI
d["Apples"] = a
d["Bananas"] = b
Execute
In Korali we have to set this flag to store the values of Apples and Bananas:
e["Store Sample Information"] = True
All evaluations can be found in the files in _korali_results.
To access the saved result of the first sample of the 8th generation, execute
import json
with open('gen00000008.json') as f:
data = json.load(f)
data["Samples"][0]["Apples"]
data["Samples"][0]["Bananas"]