Shortcuts

FitLoop

class pytorch_lightning.loops.FitLoop(min_epochs=1, max_epochs=1000)[source]

Bases: abc.ABC, Generic[pytorch_lightning.loops.base.T]

This Loop iterates over the epochs to run the training.

Parameters
  • min_epochs (Optional[int]) – The minimum number of epochs

  • max_epochs (int) – The maximum number of epochs, can be set -1 to turn this limit off

advance()[source]

Runs one whole epoch.

Return type

None

connect(epoch_loop)[source]

Connects a training epoch loop to this fit loop.

Return type

None

on_advance_end()[source]

Hook to be called each time after advance is called.

Return type

None

on_advance_start()[source]

Prepares the dataloader for training and calls the hooks on_epoch_start and on_train_epoch_start

Return type

None

on_run_end()[source]

Calls the on_train_end hook.

Return type

None

on_run_start()[source]

Calls the on_train_start hook.

Return type

None

reset()[source]

Resets the internal state of this loop.

Return type

None

teardown()[source]

Use to release memory etc.

Return type

None

property batch_idx: int

Returns the current batch index (within this epoch)

Return type

int

property current_epoch: int

Return the current epoch.

Return type

int

property done: bool

Evaluates when to leave the loop.

Returns True if trainer.should_stop was set (e.g. by early stopping) or if the maximum number of steps or epochs is reached.

Return type

bool

property global_step: int

Returns the global step.

Return type

int

property max_steps: int

Returns the maximum number of steps to run.

Return type

int

property min_steps: Optional[int]

Returns the minimum numnber of steps to run.

Return type

Optional[int]

property running_loss: pytorch_lightning.trainer.supporters.TensorRunningAccum

Returns the running loss.

Return type

TensorRunningAccum

property skip: bool

Whether we should skip the training and immediately return from the call to run().

Return type

bool

property split_idx: Optional[int]

Returns the index of the current batch split (within the current batch) for bptt.

Return type

Optional[int]

property total_batch_idx: int

Returns the current batch index (across epochs)

Return type

int

Read the Docs v: latest
Versions
latest
stable
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.8
1.3.7
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.10
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.10.0
0.9.0
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.3
0.4.9
ipynb-update
docs-search
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.