advsecurenet.shared.types.configs package
- advsecurenet.shared.types.configs.attack_configs package
- advsecurenet.shared.types.configs.attack_configs.attack_config module
- advsecurenet.shared.types.configs.attack_configs.attacker_config module
- advsecurenet.shared.types.configs.attack_configs.cw_attack_config module
- advsecurenet.shared.types.configs.attack_configs.decision_boundary_attack_config module
DecisionBoundaryAttackConfig
DecisionBoundaryAttackConfig.early_stopping
DecisionBoundaryAttackConfig.early_stopping_patience
DecisionBoundaryAttackConfig.early_stopping_threshold
DecisionBoundaryAttackConfig.initial_delta
DecisionBoundaryAttackConfig.initial_epsilon
DecisionBoundaryAttackConfig.max_delta_trials
DecisionBoundaryAttackConfig.max_epsilon_trials
DecisionBoundaryAttackConfig.max_initialization_trials
DecisionBoundaryAttackConfig.max_iterations
DecisionBoundaryAttackConfig.step_adapt
DecisionBoundaryAttackConfig.targeted
DecisionBoundaryAttackConfig.verbose
- advsecurenet.shared.types.configs.attack_configs.deepfool_attack_config module
- advsecurenet.shared.types.configs.attack_configs.fgsm_attack_config module
- advsecurenet.shared.types.configs.attack_configs.lots_attack_config module
LotsAttackConfig
LotsAttackConfig.deep_feature_layer
LotsAttackConfig.mode
LotsAttackConfig.epsilon
LotsAttackConfig.learning_rate
LotsAttackConfig.max_iterations
LotsAttackConfig.verbose
LotsAttackConfig.device
LotsAttackConfig.deep_feature_layer
LotsAttackConfig.epsilon
LotsAttackConfig.learning_rate
LotsAttackConfig.max_iterations
LotsAttackConfig.mode
LotsAttackConfig.verbose
LotsAttackMode
- advsecurenet.shared.types.configs.attack_configs.pgd_attack_config module
- advsecurenet.shared.types.configs.defense_configs package
advsecurenet.shared.types.configs.configs module
- class advsecurenet.shared.types.configs.configs.ConfigType(value)
Bases:
Enum
Enum for configuration types that can be loaded in the CLI.
- ADVERSARIAL_EVALUATION = 'adversarial_evaluation'
- ADVERSARIAL_TRAINING = 'adversarial_training'
- ATTACK = 'attack'
- DATASET = 'dataset'
- DEFENSE = 'defense'
- EVALUATION = 'evaluation'
- MODEL = 'model'
- TEST = 'test'
- TRAIN = 'train'
advsecurenet.shared.types.configs.dataloader_config module
- class advsecurenet.shared.types.configs.dataloader_config.DataLoaderConfig(dataset: BaseDataset, batch_size: int | None = 16, num_workers: int | None = 4, shuffle: bool | None = True, sampler: DistributedSampler | None = None, pin_memory: bool | None = True, drop_last: bool | None = False)
Bases:
object
This dataclass is used to store the configuration of the data loader.
- dataset: BaseDataset
advsecurenet.shared.types.configs.device_config module
advsecurenet.shared.types.configs.model_config module
- class advsecurenet.shared.types.configs.model_config.BaseModelConfig(*, model_name: str, num_classes: int | None = 1000, num_input_channels: int | None = 3, pretrained: bool | None = False)
Bases:
object
Base configuration class for different model configurations.
- model_name: str
- class advsecurenet.shared.types.configs.model_config.CreateModelConfig(model_arch_path: str | None = None, model_weights_path: str | None = None, custom_models_path: str | None = 'CustomModels', weights: str | None = 'IMAGENET1K_V1', is_external: bool = False, random_seed: int | None = None, *, model_name: str, num_classes: int | None = 1000, num_input_channels: int | None = 3, pretrained: bool | None = False)
Bases:
StandardModelConfig
,CustomModelConfig
,ExternalModelConfig
Config parameters for creating a model in the model factory.
- is_external: bool = False
- class advsecurenet.shared.types.configs.model_config.CustomModelConfig(custom_models_path: str | None = 'CustomModels', *, model_name: str, num_classes: int | None = 1000, num_input_channels: int | None = 3, pretrained: bool | None = False)
Bases:
BaseModelConfig
Configuration for a custom model.
- class advsecurenet.shared.types.configs.model_config.ExternalModelConfig(model_arch_path: str | None = None, model_weights_path: str | None = None, *, model_name: str, num_classes: int | None = 1000, num_input_channels: int | None = 3, pretrained: bool | None = False)
Bases:
BaseModelConfig
Configuration for an external model.
advsecurenet.shared.types.configs.preprocess_config module
- class advsecurenet.shared.types.configs.preprocess_config.PreprocessConfig(steps: list[PreprocessStep] | None = None)
Bases:
object
This dataclass is used to store the configuration of the preprocessing pipeline.
- steps: list[PreprocessStep] | None = None
advsecurenet.shared.types.configs.test_config module
- class advsecurenet.shared.types.configs.test_config.TestConfig(model: BaseModel, test_loader: DataLoader, criterion: str | Module = 'cross_entropy', processor: device | None = device(type='cpu'), topk: int = 1)
Bases:
object
This dataclass is used to store the configuration of the test CLI.
- criterion: str | Module = 'cross_entropy'
- test_loader: DataLoader
- topk: int = 1
advsecurenet.shared.types.configs.train_config module
- class advsecurenet.shared.types.configs.train_config.CheckpointConfig(save_checkpoint: bool = False, save_checkpoint_path: str | None = None, save_checkpoint_name: str | None = None, checkpoint_interval: int = 1, load_checkpoint: bool = False, load_checkpoint_path: str | None = None)
Bases:
object
Configuration class for the checkpoint.
- checkpoint_interval: int = 1
- load_checkpoint: bool = False
- save_checkpoint: bool = False
- class advsecurenet.shared.types.configs.train_config.FinalModelConfig(save_final_model: bool = False, save_model_path: str | None = None, save_model_name: str | None = None)
Bases:
object
Configuration class for the final model.
- save_final_model: bool = False
- class advsecurenet.shared.types.configs.train_config.ModelConfig(model: Module | None = None)
Bases:
object
Configuration class for the model.
- model: Module = None
- class advsecurenet.shared.types.configs.train_config.OptimizationConfig(optimizer: str | Optimizer = 'adam', optimizer_kwargs: dict | None = None, scheduler: str | Module | None = None, scheduler_kwargs: dict | None = None)
Bases:
object
Configuration class for the optimization process.
- optimizer: str | Optimizer = 'adam'
- class advsecurenet.shared.types.configs.train_config.TrainConfig(use_ddp: bool | None = False, processor: str | None = 'cpu', gpu_ids: str | None = None, save_final_model: bool = False, save_model_path: str | None = None, save_model_name: str | None = None, save_checkpoint: bool = False, save_checkpoint_path: str | None = None, save_checkpoint_name: str | None = None, checkpoint_interval: int = 1, load_checkpoint: bool = False, load_checkpoint_path: str | None = None, optimizer: str | Optimizer = 'adam', optimizer_kwargs: dict | None = None, scheduler: str | Module | None = None, scheduler_kwargs: dict | None = None, train_loader: DataLoader | None = None, criterion: str | Module = 'cross_entropy', epochs: int = 10, learning_rate: float = 0.001, verbose: bool = False, model: Module | None = None)
Bases:
ModelConfig
,TrainingProcessConfig
,OptimizationConfig
,CheckpointConfig
,FinalModelConfig
,DeviceConfig
Dataclass to store the overall training configuration by aggregating other configurations.
- class advsecurenet.shared.types.configs.train_config.TrainingProcessConfig(train_loader: DataLoader | None = None, criterion: str | Module = 'cross_entropy', epochs: int = 10, learning_rate: float = 0.001, verbose: bool = False)
Bases:
object
Configuration class for the training process.
- criterion: str | Module = 'cross_entropy'
- epochs: int = 10
- learning_rate: float = 0.001
- train_loader: DataLoader = None
- verbose: bool = False