main¶
- class federated.main.CustomFormatter(prog, indent_increment=2, max_help_position=24, width=None)¶
Bases:
argparse.ArgumentDefaultsHelpFormatter
Custom implementation of argparse.ArgumentDefaultsHelpFormatter.
- add_arguments(actions: dict) → None¶
Custom add_arguments of argparse.ArgumentDefaultsHelpFormatter.
- Args:
actions (dict): Actions.
- federated.main.boldify(s)¶
Function for producing boldface strings.
- federated.main.check_type(x: str, inp_type: type) → bool¶
Function for checking if a string can be converted to a certain type.
- Args:
x (str): String to convert.
inp_type (type) : Type.
- Returns:
bool: If x can be converted or not.
- federated.main.main()¶
Main method for this project. Runs pipelines with user inputs, and writes configuration to json file.
- Raises:
ValueError: If participating clients is larger than total number of clients.
- federated.main.print_training_config(args: dict) → None¶
Function for printing out training configuration.
- Args:
args (dict): Training configuration dictionary.
- federated.main.remove_slash(path: str) → str¶
Remove slash in the end of path if present.
- Args:
path (str): Path.
- Returns:
str: Path without slash.
- federated.main.validate_options_input(input_string: str, default: str, options: List[str]) → str¶
Custom input with validation where we have options.
- Args:
input_string (str): Prompt string for input.
default (str): Default value.
options (List[str]): Options for input.
- Returns:
str: Input value.
- federated.main.validate_type_input(input_string: str, default: Any, inp_type: type) → Any¶
Custom input with validation for ints, floats, and bools.
- Args:
input_string (str): Prompt string for input.
default (Any): Default value.
inp_type (type): Type to convert to.
- Returns:
Any: Converted input value.