class documentation

class SaveStatedictEveryNEpochCallback(Callback): (source)

View In Hierarchy

Callback that saves the models statedict at each Nth epoch.

Method __init__ Creates a SaveStatedictEveryNEpochCallback object.
Method after_epoch Function called after each epoch
Class Variable order Internal Callback ordering. See fastai.callback for details
Instance Variable fname Filename for the saved statedict. Epoch number is appended and filetype is '.statedict'
Instance Variable n_to_save After what recurring count of epochs should the callback save the statedict
Instance Variable path Folder to save the statedict in
Class Variable _only_train_loop Undocumented
def __init__(self, n_to_save=1, path='', fname='model'): (source)

Creates a SaveStatedictEveryNEpochCallback object.

Output path is:

    os.path.join(path, f'{fname}-{epoch}.statedict')
Parameters
n_to_saveWhen to save
pathFolder to save the statedict in
fnameFilename to use
def after_epoch(self): (source)

Function called after each epoch

Internal Callback ordering. See fastai.callback for details

Filename for the saved statedict. Epoch number is appended and filetype is '.statedict'

n_to_save = (source)

After what recurring count of epochs should the callback save the statedict

Folder to save the statedict in

_only_train_loop: bool = (source)

Undocumented