fl4health.preprocessing.autoencoders.dim_reduction module

class AeProcessor(checkpointing_path, device=device(type='cpu'))[source]

Bases: AutoEncoderProcessing

Transformer processor to encode the data using basic autoencoder.

class AutoEncoderProcessing(checkpointing_path, device=device(type='cpu'))[source]

Bases: ABC

__init__(checkpointing_path, device=device(type='cpu'))[source]

Abstract class for processors that work with a pre-trained and saved autoencoder model.

Parameters:
  • checkpointing_path (Path) – Path to the saved model.

  • device (torch.device, optional) – Device indicator for where to send the model and data samples

  • preprocessing. (for)

load_autoencoder()[source]
Return type:

None

class CvaeFixedConditionProcessor(checkpointing_path, condition, device=device(type='cpu'), return_mu_only=False)[source]

Bases: AutoEncoderProcessing

Transformer processor to encode the data using CVAE encoder with client-specific condition.

__init__(checkpointing_path, condition, device=device(type='cpu'), return_mu_only=False)[source]

Transformer processor to encode the data using a CVAE encoder with a fixed condition.

Parameters:
  • checkpointing_path (Path) – Path to the saved model.

  • condition (torch.Tensor) – Fixed condition tensor.

  • device (torch.device, optional) – Device indicator for where to send the model and data samples

  • preprocessing. (for)

  • return_mu_only (bool, optional) – If true, only mu is returned. Defaults to False.

class CvaeVariableConditionProcessor(checkpointing_path, device=device(type='cpu'), return_mu_only=False)[source]

Bases: AutoEncoderProcessing

__init__(checkpointing_path, device=device(type='cpu'), return_mu_only=False)[source]

Transformer processor to encode the data using CVAE encoder with variable condition, that is each data sample can have a specific condition.

Parameters:
  • checkpointing_path (Path) – Path to the saved model.

  • device (torch.device, optional) – Device indicator for where to send the model and data samples

  • preprocessing. (for)

  • return_mu_only (bool, optional) – If true, only mu is returned. Defaults to False.

class VaeProcessor(checkpointing_path, device=device(type='cpu'), return_mu_only=False)[source]

Bases: AutoEncoderProcessing

__init__(checkpointing_path, device=device(type='cpu'), return_mu_only=False)[source]

Transformer processor to encode the data using VAE encoder.

Parameters:
  • checkpointing_path (Path) – Path to the saved model.

  • device (torch.device, optional) – Device indicator for where to send the model and data samples

  • preprocessing. (for)

  • return_mu_only (bool, optional) – If true, only mu is returned. Defaults to False.