<jupyter_start><jupyter_text>Experimental DetailsThis notebook contains short examples on how to access all data from our published experiments. For further information, we refer the reader to [the documentation of the sacred framework](https://sacred.readthedocs.io/en/latest/) and [the util functions in our repository](https://github.com/ethz-asl/modular_semantic_segmentation/blob/6f7ff1839ac2f9b22fc3213f57a28d67807c2c50/experiments/utils.pyL61). *Optional Config and Installation*Simply jump over the steps you already did set up.**1. Configuration**<jupyter_code>import xview
from os import path

# PLEASE EDIT THE FOLLOWING PATHS FOR YOUR LOCAL SETTINGS

# path where the image data will be/is stored
DATA_BASEPATH = '/tmp/test'

# path where experiment configs will be stored
EXPERIMENT_STORAGE_FOLDER = '/tmp/exp'

# only change in case you want to use tensorboard for model training, otherwise not relevant
EXP_OUT = '/tmp'

print('writing settings to %s' % path.join(path.dirname(xview.__file__), 'settings.py'))
with open(path.join(path.dirname(xview.__file__), 'settings.py'), 'w') as settings_file:
    settings_file.write("DATA_BASEPATH = '%s'\n" % DATA_BASEPATH)
    settings_file.write("EXPERIMENT_STORAGE_FOLDER = '%s'\n" % EXPERIMENT_STORAGE_FOLDER)
    settings_file.write("EXP_OUT = '%s'\n" % EXP_OUT)<jupyter_output><empty_output><jupyter_text>**2. Downloading Experimental Data**  All training and measurement experiments are bundeled into an archive that is downloaded and installed. This gives you access to pre-trained models and all experimental configurations.<jupyter_code>! wget http://robotics.ethz.ch/~asl-datasets/2018_modular_semantic_segmentation/experimental_data.tar.gz -O /tmp/experimental_data.tar.gz
import tarfile
from os import path
from xview.settings import EXPERIMENT_STORAGE_FOLDER
tar = tarfile.open('/tmp/experimental_data.tar.gz')
tar.extractall(path=EXPERIMENT_STORAGE_FOLDER)
tar.close()
! rm /tmp/experimental_data.tar.gz<jupyter_output>--2018-07-23 16:04:06--  http://robotics.ethz.ch/~asl-datasets/2018_modular_semantic_segmentation/experimental_data.tar.gz
Resolving robotics.ethz.ch (robotics.ethz.ch)... 192.168.3.11
Connecting to robotics.ethz.ch (robotics.ethz.ch)|192.168.3.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1588955377 (1.5G) [application/x-gzip]
Saving to: ‘/tmp/experimental_data.tar.gz’

/tmp/experimental_d 100%[===================>]   1.48G  87.5MB/s    in 31s     

2018-07-23 16:04:36 (49.7 MB/s) - ‘/tmp/experimental_data.tar.gz’ saved [1588955377/1588955377]<jupyter_text>Accessing Details of an ExperimentAll experiments referenced in other notebooks were recorded using [sacred](http://sacred.readthedocs.io/en/latest/). You can access details in the following ways:<jupyter_code>from experiments.utils import ExperimentData
exp = ExperimentData(868)<jupyter_output><empty_output><jupyter_text>**1. Configuration**<jupyter_code>exp.get_record()['config']<jupyter_output><empty_output><jupyter_text>**2. Captured Output**<jupyter_code>exp.get_record()['captured_out']<jupyter_output><empty_output><jupyter_text>**3. Results**  Results are stored in a machine-readable form. For more documentation of which metric is stored where, please have a look at the corresponding [experimental script](https://github.com/ethz-asl/modular_semantic_segmentation/tree/publish/experiments). Which file and command were used can be accessed as follows:<jupyter_code>print('file: experiments/{}, function: {}'.format(
    exp.get_record()['experiment']['mainfile'], exp.get_record()['meta']['command']))
print(exp.get_record()['info'].keys())
exp.get_record()['info']<jupyter_output>dict_keys(['confusion_matrices', 'confusion_matrix', 'measurements'])
{'fraction_non_alphanumeric': 0.12510002667377967, 'fraction_numerical': 0.03761002934115764, 'mean_word_length': 6.396449704142012, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '223141', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1221, 'n_words': 284, 'path': 'Experimental Details.ipynb', 'repo_name': 'ethz-asl/modular_semantic_segmentation', 'size': '3753'}