Automating Ablation Studies of Deep Learning Models using Batch Script

<p>In this article, we will look at a short example of how we can automate running ablation study experiments on our deep learning models using batch scripts in Windows.</p> <blockquote> <p>Step 1</p> </blockquote> <p>Create a&nbsp;<strong><em>.bat</em></strong>&nbsp;file in your editor</p> <blockquote> <p>Step 2: Identify the hyper-parameters you want to sweep over in your experiments</p> </blockquote> <p>For this article, let us consider the hyper-parameter to be &lambda;. Also, we would like to see the effect of batch size for each &lambda; value.</p> <pre> @echo off setlocal EnableDelayedExpansion set lambda=2 10 50 100 set bs=128 256 512 set /a exprun = 1 for %%i in (%lambda%) do ( for %%j in (%bs%) do ( echo lambda=%%i/100 echo bs=%%j set /a exprun=!exprun!+1 echo !exprun! python train.py --lambda %%i --bs %%j --run !exprun! ) ) endlocal</pre> <p>In the above code, we pass the arguments&nbsp;<strong><em>lambda</em></strong>&nbsp;and&nbsp;<strong><em>bs</em></strong>&nbsp;to the python file&nbsp;<strong><em>trian.py</em></strong>&nbsp;and also increment our experiment number counter&nbsp;<strong><em>exprun.</em></strong></p> <p><a href="https://medium.com/the-owl/automating-ablation-studies-of-deep-learning-models-using-batch-script-968981870329"><strong>Read More</strong></a></p>
Tags: Batch script