create_cv_jobs.m 997 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
eta = [0.01,0.05,0.1,0.2];
max_depth = 3:10;
nboost = 1000:1000:5000;

A = combvec(eta,max_depth,nboost)';
jobdir = '/data/user/mdefende/Projects/ctmodel-ml/model-py/cv-jobs';
for ii = 1:length(A)
    jobname = ['eta' num2str(A(ii,1)) '_depth' num2str(A(ii,2)) '_nboost' num2str(A(ii,3)) '.sh'];
    
    fid = fopen(fullfile(jobdir,jobname),'w');
    fprintf(fid,'#!/bin/bash\n');
    fprintf(fid,'#SBATCH --partition=pascalnodes\n');
    fprintf(fid,'#SBATCH --time=6:00:00\n');
    fprintf(fid,'#SBATCH --ntasks=4\n');
    fprintf(fid,'#SBATCH --mem-per-cpu=25\n');
    fprintf(fid,['#SBATCH --output=' jobname '.txt\n\n']);

    fprintf(fid,'module load Anaconda3/5.3.0\n');
    fprintf(fid,'source activate ctmodel-ml\n\n');

    fprintf(fid,'cd /data/user/mdefende/Projects/ctmodel-ml/model-py\n\n');

    fprintf(fid,['python model-indiv-cv.py ' num2str(A(ii,1)) ' ' num2str(A(ii,2)) ' ' num2str(A(ii,3)) '\n']);
    fclose(fid);
    
    system(['sbatch ' fullfile(jobdir,jobname)]);
end