#!/bin/bash

readonly WORK_DIR=. 
readonly LOG_TOP_DIR=${WORK_DIR}/log
readonly experiment_name=Section_7_X_DomainAdaptation
readonly method_name=alphaDiv
readonly clf_algo=Linear_Classifier
mkdir -p $LOG_TOP_DIR


n_feas_list=(8 16 32 64 128)


for n_f in  "${n_feas_list[@]}"; do 
    run_description=num_feats-${n_f}
    source ./env_dre_expr/bin/activate
    LOG_FILE_NAME=${method_name}_$(date '+%Y-%m-%d_%H%M_%S').log
    LOG_FILE=$LOG_TOP_DIR/${LOG_FILE_NAME}
    set -x
    CUDA_VISIBLE_DEVICES=0,\
        python da_main.py -m seed=1 \
        dataset=AMAZON_REVIEWS\
        clf_algo=Linear_Classifier dre_method=${method_name}\
        num_feats=${n_f}\
        run_description=${run_description}\
        experiment_name=${experiment_name} > $LOG_FILE 2>&1
    set +x
    deactivate
done


for n_f in  "${n_feas_list[@]}"; do 
    run_description=num_feats-${n_f}
    source ./env_dre_expr/bin/activate
    LOG_FILE_NAME=${method_name}_$(date '+%Y-%m-%d_%H%M_%S').log
    LOG_FILE=$LOG_TOP_DIR/${LOG_FILE_NAME}
    set -x
    CUDA_VISIBLE_DEVICES=0,\
        python da_main.py -m seed=1 \
        dataset=AMAZON_REVIEWS\
        clf_algo=GDBT_Classifier dre_method=${method_name}\
        num_feats=${n_f}\
        run_description=${run_description}\
        experiment_name=${experiment_name} > $LOG_FILE 2>&1
    set +x
    deactivate
done