Skip to content

Commit

Permalink
code changes
Browse files Browse the repository at this point in the history
Signed-off-by: yes <[email protected]>
  • Loading branch information
tanwarsh committed Dec 11, 2024
1 parent 7e379b3 commit 6461a8a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion openfl-workspace/keras_cnn_mnist/src/taskrunner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2020-2021 Intel Corporation
# Copyright (C) 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""You may copy this file as the starting point of your own model."""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2020-2021 Intel Corporation
# Copyright (C) 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

"""You may copy this file as the starting point of your own model."""
Expand Down
3 changes: 1 addition & 2 deletions openfl-workspace/keras_nlp/plan/plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ collaborator :
defaults : plan/defaults/collaborator.yaml
template : openfl.component.Collaborator
settings :
epochs_per_round : 10
polling_interval : 4
db_store_rounds: 2
delta_updates : false
opt_treatment : RESET

Expand Down
7 changes: 4 additions & 3 deletions openfl-workspace/keras_nlp/src/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
from logging import getLogger
from typing import Optional
from typing import Iterator
from typing import Tuple
from typing import Union

Expand Down Expand Up @@ -55,7 +56,7 @@ def get_feature_shape(self) -> Tuple[int, ...]:
"""Get the shape of an example feature array."""
return self.X_train[0].shape

def get_train_loader(self, batch_size: Optional[int] = None):
def get_train_loader(self, batch_size: Optional[int] = None) -> Iterator[Tuple[np.ndarray]]:
"""
Get training data loader.
Expand All @@ -66,7 +67,7 @@ def get_train_loader(self, batch_size: Optional[int] = None):
return self._get_batch_generator(X1=self.X_train[0], X2=self.X_train[1],
y=self.y_train, batch_size=batch_size)

def get_valid_loader(self, batch_size: Optional[int] = None):
def get_valid_loader(self, batch_size: Optional[int] = None) -> Iterator[Tuple[np.ndarray]]:
"""
Get validation data loader.
Expand Down Expand Up @@ -98,7 +99,7 @@ def get_valid_data_size(self) -> int:
def _batch_generator(X1: np.ndarray, X2: np.ndarray,
y: np.ndarray, idxs: np.ndarray,
batch_size: int,
num_batches: int):
num_batches: int) -> Iterator[Tuple[np.ndarray]]:
"""
Generate batch of data.
Expand Down
2 changes: 1 addition & 1 deletion openfl-workspace/keras_nlp/src/taskrunner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Copyright (C) 2020-2021 Intel Corporation
"""Copyright (C) 2020-2024 Intel Corporation
SPDX-License-Identifier: Apache-2.0
Licensed subject to the terms of the separately executed evaluation
Expand Down

0 comments on commit 6461a8a

Please sign in to comment.