From 5f542fb577f8c5b747b5a26c4c0f5f121913f8f3 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 13 May 2026 18:25:05 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=A3=8E=E6=A0=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ginka/train_seperated.py | 20 ++++++++++---------- prompt.md | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ginka/train_seperated.py b/ginka/train_seperated.py index b5e7609..425e5f6 100644 --- a/ginka/train_seperated.py +++ b/ginka/train_seperated.py @@ -93,12 +93,12 @@ FOCAL_GAMMA = 2.0 # Focal Loss 参数 VQ_BETA = 0.5 # 承诺损失权重 # 训练超参 -BATCH_SIZE = 64 # 每批样本数 -LR = 1e-4 # AdamW 初始学习率 -MIN_LR = 1e-6 # 余弦退火最低学习率 -WEIGHT_DECAY = 1e-4 # L2 正则化系数 -EPOCHS = 400 # 总训练轮数 -CHECKPOINT = 20 # 每隔多少 epoch 保存检查点并执行验证 +BATCH_SIZE = 64 # 每批样本数 +LR = 1e-4 # AdamW 初始学习率 +MIN_LR = 1e-6 # 余弦退火最低学习率 +WEIGHT_DECAY = 1e-4 # L2 正则化系数 +EPOCHS = 400 # 总训练轮数 +CHECKPOINT = 20 # 每隔多少 epoch 保存检查点并执行验证 device = torch.device( "cuda:1" if torch.cuda.is_available() @@ -173,10 +173,10 @@ def focal_loss(logits, target): def random_struct(device: torch.device) -> torch.Tensor: # 随机采样一组结构参量,用于无条件自由生成 # struct_inject 格式:[cond_sym(0-7), cond_room(0-2), cond_branch(0-2), cond_outer(0-1)] - cond_sym = random.randint(0, 7) # 地图对称类型 - cond_room = random.randint(0, 2) # 房间数量档位 - cond_branch = random.randint(0, 2) # 分支复杂度档位 - cond_outer = random.randint(0, 1) # 是否有外围走廊 + cond_sym = random.randint(0, 7) # 地图对称类型 + cond_room = random.randint(0, 2) # 房间数量档位 + cond_branch = random.randint(0, 2) # 分支复杂度档位 + cond_outer = random.randint(0, 1) # 是否有外围走廊 return torch.LongTensor([cond_sym, cond_room, cond_branch, cond_outer]).unsqueeze(0).to(device) def maskgit_sample( diff --git a/prompt.md b/prompt.md index 0897989..7e9d2f2 100644 --- a/prompt.md +++ b/prompt.md @@ -26,7 +26,7 @@ #### Python -- 不使用三引号注释(`"""..."""`),一律改用 `#` 注释 +- 不使用三引号注释(`"""..."""`),一律改用 `#` 注释。对于行后的注释,注释的 # 应该在语句后面空一格的地方开始,不要多空,也不要少空,例如 `a = b # 注释内容`。 - 不出现连续空行(即空行仅允许连续出现一行)不出现连续空格,例如下面的例子就不允许出现: ```python