Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
gubertoli committed Nov 23, 2023
1 parent fed2ddf commit 3db5ece
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions baselines/fedavgm/fedavgm/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class FlowerClient(fl.client.NumPyClient):
"""Standard Flower client."""

# pylint: disable=too-many-arguments
def __init__(self, x_train, y_train, x_val, y_val, model, num_classes) -> None:
# local model
self.model = instantiate(model)
Expand Down
1 change: 1 addition & 0 deletions baselines/fedavgm/fedavgm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from fedavgm.server import get_evaluate_fn


# pylint: disable=too-many-locals
@hydra.main(config_path="conf", config_name="base", version_base=None)
def main(cfg: DictConfig) -> None:
"""Run the baseline.
Expand Down
2 changes: 1 addition & 1 deletion baselines/fedavgm/fedavgm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from keras.optimizers import SGD
from keras.regularizers import l2
from tensorflow import keras
from tensorflow.nn import local_response_normalization
from tensorflow.nn import local_response_normalization # pylint: disable=import-error


def cnn(input_shape, num_classes, learning_rate):
Expand Down
6 changes: 4 additions & 2 deletions baselines/fedavgm/fedavgm/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def get_on_fit_config(config: DictConfig):
The config dict is sent to the client fit() method.
"""

def fit_config_fn(server_round: int):
def fit_config_fn(server_round: int): # pylint: disable=unused-argument
# option to use scheduling of learning rate based on round
# if server_round > 50:
# lr = config.lr / 10
Expand All @@ -28,7 +28,9 @@ def get_evaluate_fn(model, x_test, y_test, num_rounds, num_classes):
The method evaluate_fn runs after global model aggregation.
"""

def evaluate_fn(server_round: int, parameters, config):
def evaluate_fn(
server_round: int, parameters, config
): # pylint: disable=unused-argument
if server_round == num_rounds: # evaluates global model just on the last round
# instantiate the model
model.set_weights(parameters)
Expand Down
2 changes: 2 additions & 0 deletions baselines/fedavgm/fedavgm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

from fedavgm.dataset import cifar10, partition

# pylint: disable=too-many-locals


def plot_concentrations_cifar10():
"""Create a plot with different concentrations for dataset using LDA."""
Expand Down

0 comments on commit 3db5ece

Please sign in to comment.