<jupyter_start><jupyter_text>BATADAL dataset results<jupyter_code>import sys
sys.path.append('./../')
import matplotlib
%matplotlib inline
import visualisation<jupyter_output>/home/alex/anaconda2/envs/ANT/lib/python2.7/site-packages/matplotlib/__init__.py:1405: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

  warnings.warn(_use_error_msg)<jupyter_text>(i) Train an ANT on the IoT image recognition datasetFrom the code directory, run the following command to train an ANT:```bashpython tree.py --dataset batadal --experiment demo1 --subexperiment ant_batadal --batch-size 256 --epochs_patience 5 --epochs_node 100 --epochs_finetune 200  -t_ver 3 -t_k 3 -t_ngf 96 -r_ver 1 -r_ngf 48 -r_k 3 -s_ver 1 --batch_norm --maxdepth 10 --num_workers 0 --seed 0```It takes 0.5 hour on a single P100 GPU.  (ii) Plot classification accuracyThe dotted lines correspond to the epoch number at which the refinement phase started.<jupyter_code>exp_dir = './../experiments/batadal/demoLast/'
models_list = ['ant_batadal']

records_file_list = [exp_dir + model_name + '/checkpoints/records.json' for model_name in models_list]
model_files = [exp_dir + model_name + '/checkpoints/model.pth' for model_name in models_list]

visualisation.plot_performance(records_file_list, models_list, ymax = 1.0, figsize=(10,7), finetune_position=True)
visualisation.plot_accuracy(records_file_list, models_list, figsize=(10,7), ymin=0, ymax=105, finetune_position=True)<jupyter_output>297
297
ant_batadal: test accuracy = 90.3<jupyter_text>(iii) Compute model size<jupyter_code>_ = visualisation.compute_number_of_params(model_files, models_list, is_gpu=False)<jupyter_output>Model: ant_batadal
Number of parameters summary:
    Total: 88802 
    Max per branch: 88802 
    Min per branch: 88802 
    Average per branch: 88802.0<jupyter_text>(iv) Visualise the tree structure<jupyter_code>fig_dir = exp_dir + 'ant_cifar10' + '/figures/'
visualisation.visualise_treestructures(fig_dir, figsize=(10,20))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10197519522278364, 'fraction_numerical': 0.03858520900321544, 'mean_word_length': 5.870662460567823, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '561572', 'license': 'MIT', 'n_tokens_mistral': 819, 'n_tokens_neox': 733, 'n_words': 193, 'path': 'notebooks/BATADAL.ipynb', 'repo_name': '404alex/AdaptiveNeuralTrees', 'size': '2177'}