training.rst 691 Bytes
Newer Older
Jeff Rasley's avatar
Jeff Rasley committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Training API
============

:func:`deepspeed.initialize` returns a *model engine* in its first argument
of type ``DeepSpeedLight``. This engine is used to progress training:

.. code-block:: python

    for step, batch in enumerate(data_loader):
        #forward() method
        loss = model_engine(batch)

        #runs backpropagation
        model_engine.backward(loss)

        #weight update
        model_engine.step()

Forward Propagation
-------------------
.. autofunction:: deepspeed.DeepSpeedLight.forward

Backward Propagation
--------------------
.. autofunction:: deepspeed.DeepSpeedLight.backward

Optimizer Step
--------------
.. autofunction:: deepspeed.DeepSpeedLight.step