Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CDB_study.slurm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#SBATCH --mem=32G
#SBATCH --time=48:00:00
#SBATCH --partition=plgrid-gpu-a100
#SBATCH -A plgautopt26-gpu-a100
#SBATCH -A plgrldas2026-gpu-a100
#SBATCH --array=0-11 # 12 tasks total

SEED=${1:-42}
Expand Down
2 changes: 1 addition & 1 deletion comprehensive_study.slurm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#SBATCH --mem=32G
#SBATCH --time=48:00:00
#SBATCH --partition=plgrid-gpu-a100
#SBATCH -A plgautopt26-gpu-a100
#SBATCH -A plgrldas2026-gpu-a100
#SBATCH --array=0-12 # Increased to 13 tasks total to split sequential runs

# 1st argument: SEED (Default: 42)
Expand Down
48 changes: 26 additions & 22 deletions dynamicalgorithmselection/agents/ppo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,19 @@ def __init__(self, dim, optimizer_num, device):
super().__init__()
self.device = device
self.optimizer_num = optimizer_num
self.embedders = [
(
nn.Sequential(
nn.Linear(dim, 64),
nn.ReLU(),
nn.Linear(64, 1),
nn.ReLU(),
)
).to(device)
for _ in range(2 * optimizer_num)
]
self.embedders = nn.ModuleList(
[
(
nn.Sequential(
nn.Linear(dim, 64),
nn.ReLU(),
nn.Linear(64, 1),
nn.ReLU(),
)
).to(device)
for _ in range(2 * optimizer_num)
]
)

self.embedder_final = nn.Sequential(
nn.Linear(9 + optimizer_num * 2, 64),
Expand Down Expand Up @@ -203,17 +205,19 @@ class RLDASCritic(nn.Module):
def __init__(self, dim, optimizer_num, device):
super().__init__()
self.device = device
self.embedders = [
(
nn.Sequential(
nn.Linear(dim, 64),
nn.ReLU(),
nn.Linear(64, 1),
nn.ReLU(),
)
).to(device)
for _ in range(2 * optimizer_num)
]
self.embedders = nn.ModuleList(
[
(
nn.Sequential(
nn.Linear(dim, 64),
nn.ReLU(),
nn.Linear(64, 1),
nn.ReLU(),
)
).to(device)
for _ in range(2 * optimizer_num)
]
)
self.embedder_final = nn.Sequential(
nn.Linear(9 + optimizer_num * 2, 64),
nn.Tanh(),
Expand Down
6 changes: 4 additions & 2 deletions dynamicalgorithmselection/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import os
import shutil
import warnings
from random import seed as set_random_seed
from typing import List, Type, Dict, Any
import cocopp
Expand All @@ -17,6 +18,8 @@
from dynamicalgorithmselection.experiments.utils import DIMENSIONS
from dynamicalgorithmselection.optimizers.Optimizer import Optimizer

warnings.filterwarnings("ignore")

AGENTS_DICT = {
"random": RandomAgent,
"policy-gradient": PolicyGradientAgent,
Expand Down Expand Up @@ -144,7 +147,7 @@ def parse_arguments():
"--reward-option",
type=int,
choices=[1, 2, 3, 4],
default=2,
default=1,
help="id of method used to compute reward (valid options: 1-4, default 2 maps to r2)",
)

Expand Down Expand Up @@ -201,7 +204,6 @@ def test(args, action_space):
options = {
"action_space": action_space,
} | common_options(args)
# agent_state = torch.load(f)
if args.agent == "policy-gradient":
options.update(
torch.load(
Expand Down
2 changes: 2 additions & 0 deletions dynamicalgorithmselection/optimizers/DE/DE.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def __init__(self, problem, options):
self.n_individuals is None
): # number of offspring, aka offspring population size
self.n_individuals = 170
self.Nmin = 30 # Discrepancy: Nmin is 30 in Population.py
self.Nmax = 170
assert self.n_individuals > 0
self._n_generations = 0 # number of generations
self._printed_evaluations = self.n_function_evaluations
Expand Down
Loading