Types#

class pfl.common_types.Population(value)#

Enum representing the different pools the devices are divided up into.

class pfl.common_types.Saveable#

Interface to allow save and load the state of an object to/from disk.

This is useful to e.g. add fault tolerance to your components if you want to be able to resume training after a crash.

abstract save(dir_path)#

Save state of object to disk. Should be able to interpret saved state as a checkpoint that can be restored with load.

Parameters:

dir_path (str) – Directory on disk to store state.

Return type:

None

abstract load(dir_path)#

Load checkpoint from disk, which is the state previously saved with save.

Parameters:

dir_path (str) – Path to root directory where checkpoint can be loaded from. Should be same path as used with save.

Return type:

None