Skip to content

Commit bfb352b

Browse files
committed
change huber_schedule from exponential to snr
1 parent c973b29 commit bfb352b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ The majority of scripts is licensed under ASL 2.0 (including codes from Diffuser
137137

138138
## Change History
139139

140+
### Apr 7, 2024 / 2024-04-07: v0.8.7
141+
142+
- The default value of `huber_schedule` in Scheduled Huber Loss is changed from `exponential` to `snr`, which is expected to give better results.
143+
144+
- Scheduled Huber Loss の `huber_schedule` のデフォルト値を `exponential` から、より良い結果が期待できる `snr` に変更しました。
145+
140146
### Apr 7, 2024 / 2024-04-07: v0.8.6
141147

142148
#### Highlights
@@ -216,7 +222,7 @@ The newly added arguments loss_type, huber_schedule, and huber_c allow for the s
216222
See PR [#1228](https://github.com/kohya-ss/sd-scripts/pull/1228/) for details.
217223

218224
- `loss_type`: Specify the loss function type. Choose `huber` for Huber loss, `smooth_l1` for smooth L1 loss, and `l2` for MSE loss. The default is `l2`, which is the same as before.
219-
- `huber_schedule`: Specify the scheduling method. Choose `exponential`, `constant`, or `SNR`. The default is `exponential`.
225+
- `huber_schedule`: Specify the scheduling method. Choose `exponential`, `constant`, or `snr`. The default is `snr`.
220226
- `huber_c`: Specify the Huber's parameter. The default is `0.1`.
221227

222228
Please read [Releases](https://github.com/kohya-ss/sd-scripts/releases) for recent updates.
@@ -297,7 +303,7 @@ Please read [Releases](https://github.com/kohya-ss/sd-scripts/releases) for rece
297303
詳細は PR [#1228](https://github.com/kohya-ss/sd-scripts/pull/1228/) をご覧ください。
298304

299305
- `loss_type` : 損失関数の種類を指定します。`huber` で Huber損失、`smooth_l1` で smooth L1 損失、`l2` で MSE 損失を選択します。デフォルトは `l2` で、従来と同様です。
300-
- `huber_schedule` : スケジューリング方法を指定します。`exponential` で指数関数的、`constant` で一定、`snr` で信号対雑音比に基づくスケジューリングを選択します。デフォルトは `exponential` です。
306+
- `huber_schedule` : スケジューリング方法を指定します。`exponential` で指数関数的、`constant` で一定、`snr` で信号対雑音比に基づくスケジューリングを選択します。デフォルトは `snr` です。
301307
- `huber_c` : Huber損失のパラメータを指定します。デフォルトは `0.1` です。
302308

303309
PR 内でいくつかの比較が共有されています。この機能を試す場合、最初は `--loss_type smooth_l1 --huber_schedule snr --huber_c 0.1` などで試してみるとよいかもしれません。

library/train_util.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3246,10 +3246,10 @@ def add_training_arguments(parser: argparse.ArgumentParser, support_dreambooth:
32463246
parser.add_argument(
32473247
"--huber_schedule",
32483248
type=str,
3249-
default="exponential",
3249+
default="snr",
32503250
choices=["constant", "exponential", "snr"],
3251-
help="The scheduling method for Huber loss (constant, exponential, or SNR-based). Only used when loss_type is 'huber' or 'smooth_l1'. default is exponential"
3252-
+ " / Huber損失のスケジューリング方法(constant、exponential、またはSNRベース)。loss_typeが'huber'または'smooth_l1'の場合に有効、デフォルトはexponential",
3251+
help="The scheduling method for Huber loss (constant, exponential, or SNR-based). Only used when loss_type is 'huber' or 'smooth_l1'. default is snr"
3252+
+ " / Huber損失のスケジューリング方法(constant、exponential、またはSNRベース)。loss_typeが'huber'または'smooth_l1'の場合に有効、デフォルトは snr",
32533253
)
32543254
parser.add_argument(
32553255
"--huber_c",

0 commit comments

Comments
 (0)