Skip to content

Commit

Permalink
Fix B018 error for latest flake8-bugbear (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
itrushkin authored Nov 29, 2021
1 parent 3f8d2a8 commit c33f7bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
5 changes: 1 addition & 4 deletions openfl-workspace/torch_cnn_mnist/src/pt_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def init_network(self,
fully-connected layer (Default = 500)
**kwargs: Additional arguments to pass to the function
"""
'''
FIXME: We are tracking only side lengths (rather than
length and width) as we are assuming square
shapes for feature and kernels.
Expand All @@ -91,8 +89,7 @@ def init_network(self,
(Note this criterion held for the original input sizes considered
for this model: 28x28 and 32x32 when used with the default values
above)
'''
"""
self.pool_sqrkernel_size = pool_sqrkernel_size
channel = self.data_loader.get_feature_shape()[0] # (channel, dim1, dim2)
self.conv1 = nn.Conv2d(channel, conv1_channels_out, conv_sqrkernel_size, 1)
Expand Down
24 changes: 11 additions & 13 deletions openfl/component/collaborator/collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@ class DevicePolicy(Enum):


class OptTreatment(Enum):
"""Optimizer Methods."""
"""Optimizer Methods.
RESET = 1
'''
RESET tells each collaborator to reset the optimizer state at the beginning
- RESET tells each collaborator to reset the optimizer state at the beginning
of each round.
'''
CONTINUE_LOCAL = 2
'''
CONTINUE_LOCAL tells each collaborator to continue with the local optimizer
- CONTINUE_LOCAL tells each collaborator to continue with the local optimizer
state from the previous round.
'''
CONTINUE_GLOBAL = 3
'''
CONTINUE_GLOBAL tells each collaborator to continue with the federally
- CONTINUE_GLOBAL tells each collaborator to continue with the federally
averaged optimizer state from the previous round.
'''
"""

RESET = 1
CONTINUE_LOCAL = 2
CONTINUE_GLOBAL = 3


class Collaborator:
Expand Down

0 comments on commit c33f7bb

Please sign in to comment.