"src/vscode:/vscode.git/clone" did not exist on "390bb8534c10ba45e6158235fcea69615eab9e52"
optimizer_schedules.rst 1.26 KB
Newer Older
thomwolf's avatar
thomwolf committed
1
2
3
Optimizer
----------------------------------------------------

4
5
6
7
8
The ``.optimization`` module provides:

- an optimizer with weight decay fixed that can be used to fine-tuned models, and
- several schedules in the form of schedule objects that inherit from ``_LRSchedule``:

thomwolf's avatar
thomwolf committed
9
10
11
``AdamW``
~~~~~~~~~~~~~~~~

12
.. autoclass:: transformers.AdamW
thomwolf's avatar
thomwolf committed
13
14
15
16
17
    :members:

Schedules
----------------------------------------------------

18
19
20
Learning Rate Schedules
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

21
.. autofunction:: transformers.get_constant_schedule
thomwolf's avatar
thomwolf committed
22

23

24
.. autofunction:: transformers.get_constant_schedule_with_warmup
thomwolf's avatar
thomwolf committed
25

26
27
28
29
30
.. image:: /imgs/warmup_constant_schedule.png
    :target: /imgs/warmup_constant_schedule.png
    :alt:


31
.. autofunction:: transformers.get_cosine_schedule_with_warmup
thomwolf's avatar
thomwolf committed
32
33
    :members:

34
35
36
37
38
.. image:: /imgs/warmup_cosine_schedule.png
    :target: /imgs/warmup_cosine_schedule.png
    :alt:


39
.. autofunction:: transformers.get_cosine_with_hard_restarts_schedule_with_warmup
thomwolf's avatar
thomwolf committed
40

41
42
43
44
45
46
.. image:: /imgs/warmup_cosine_hard_restarts_schedule.png
    :target: /imgs/warmup_cosine_hard_restarts_schedule.png
    :alt:



47
.. autofunction:: transformers.get_linear_schedule_with_warmup
48
49
50
51

.. image:: /imgs/warmup_linear_schedule.png
    :target: /imgs/warmup_linear_schedule.png
    :alt: