From adaf8cc50e1bd98081a1b0370df1651e43268f31 Mon Sep 17 00:00:00 2001 From: weixin_46229132 Date: Thu, 3 Apr 2025 14:20:27 +0800 Subject: [PATCH] =?UTF-8?q?dqn=E8=B7=91=E9=80=9A=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- human_action.py | 6 +++--- mtkl_sovler2.py | 2 +- solutions/dqn_params_50_50_3.json | 8 ++++---- visualization.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/human_action.py b/human_action.py index 1436db3..8421c64 100644 --- a/human_action.py +++ b/human_action.py @@ -13,12 +13,12 @@ print('state:', state) # action_series = [1] * 30 # action_series = [[0.2], [0.4], [0.7], [0.5]] # action_series = [[-0.08], [-0.08], [0], [0]] -action_series = [3, 5, 3, 5, 3, 5, 3, 5, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, - 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4] +action_series = [3, 5, 3, 5, 1, 1, 3, 5, 1, 5, 3, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1] for i in range(100): action = action_series[i] - state, reward, done, info, _ = env.step(action) + state, reward, done, _, info = env.step(action) print('state:', state) print('reward:', reward) if done: diff --git a/mtkl_sovler2.py b/mtkl_sovler2.py index ae53b2e..4b47b5b 100644 --- a/mtkl_sovler2.py +++ b/mtkl_sovler2.py @@ -12,7 +12,7 @@ random.seed(42) # --------------------------- # 需要修改的超参数 # --------------------------- -num_iterations = 300000000 +num_iterations = 10000000000 # 随机生成分区的行分段数与列分段数 R = random.randint(0, 3) # 行分段数 C = random.randint(0, 3) # 列分段数 diff --git a/solutions/dqn_params_50_50_3.json b/solutions/dqn_params_50_50_3.json index 2ca2987..128d989 100644 --- a/solutions/dqn_params_50_50_3.json +++ b/solutions/dqn_params_50_50_3.json @@ -1,10 +1,10 @@ { - "best_time": 8848.626166217664, + "best_time": 8820.015746422654, "row_cuts": [ 0, - 0.2700000000000001, + 0.2900000000000001, 0.4700000000000001, - 0.76, + 0.77, 1 ], "col_cuts": [ @@ -26,5 +26,5 @@ 6, 0 ], - "timestamp": "2025-04-01 20:05:51" + "timestamp": "2025-04-03 10:58:44" } \ No newline at end of file diff --git a/visualization.py b/visualization.py index 8db22e6..c62eb52 100644 --- a/visualization.py +++ b/visualization.py @@ -200,7 +200,7 @@ if __name__ == "__main__": # 需要修改的超参数 # --------------------------- params_file = 'params_50_50_3' - solution_file = r'solutions\finetune_params_50_50_3.json' + solution_file = r'solutions\dqn_params_50_50_3_2.json' with open(params_file + '.yml', 'r', encoding='utf-8') as file: params = yaml.safe_load(file)