-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_experiments.sh
More file actions
47 lines (36 loc) · 1.41 KB
/
Copy pathgenerate_experiments.sh
File metadata and controls
47 lines (36 loc) · 1.41 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Define parameters
datasets=("Cora" "Citeseer" "Cs" "Physics")
alg_methods=("FedKD")
base_dir="script/plot"
gpu_id=3
# Create base directory
mkdir -p "$base_dir"
# Clear previous running scripts
> "$base_dir/run_all.sh"
# Iterate over all datasets and algorithm methods
for dataset in "${datasets[@]}"; do
# Create dataset directory
dataset_dir="$base_dir/$dataset"
mkdir -p "$dataset_dir"
for alg_method in "${alg_methods[@]}"; do
# Script file name
script_name="plot_${alg_method,,}_${dataset,,}.sh"
script_path="$dataset_dir/$script_name"
# Write script content
cat > "$script_path" << SCRIPT
#!/bin/bash
python run_node_task_main.py --dataset $dataset --num_workers 10 --overlapping_rate 0.0 --is_iid iid --alg_method $alg_method --ALPHA 1.0 --lam_real 0 --sample_num 100 --lam2 0 --gpu_id $gpu_id --draw_decision_bound
SCRIPT
# Make the script executable
chmod +x "$script_path"
# Generate run commands and add them to the main run script
echo "nohup sh $script_path > $dataset_dir/${script_name%.sh}.log 2>&1 &" >> "$base_dir/run_all.sh"
echo "创建脚本: $script_path"
done
done
# Make the main run script executable
chmod +x "$base_dir/run_all.sh"
echo "Completed!"
echo "All scripts have been generated in: $base_dir"
echo "To run all experiments, execute: sh $base_dir/run_all.sh"