Skip to content

Commit

Permalink
Removed some necessary None from python code.
Browse files Browse the repository at this point in the history
Signed-off-by: xinyao1994 <[email protected]>
  • Loading branch information
XinYao1994 committed Mar 30, 2022
1 parent efacab4 commit 1d1c37b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
s3_transmitter = FederatedLearningV2.get_transmitter_from_config()

class SddDataset():
def __init__(self, x, y) -> None:
def __init__(self, x, y):
self.labels = y
self.images = x
self.index = 0
Expand All @@ -54,7 +54,7 @@ def __next__(self):


class myDataset:
def __init__(self, trainset=None, testset=None) -> None:
def __init__(self, trainset=None, testset=None):
self.customized = True
transform = [
c_vision.Resize((128, 128)),
Expand Down Expand Up @@ -107,7 +107,7 @@ def construct(self, x):
return x

class Estimator:
def __init__(self) -> None:
def __init__(self):
self.model = SddModel()
self.pretrained = None
self.saved = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
s3_transmitter = FederatedLearningV2.get_transmitter_from_config()

class SddDataset(Dataset):
def __init__(self, x, y) -> None:
def __init__(self, x, y):
self.images = x
self.labels = y

Expand All @@ -46,13 +46,13 @@ def __getitem__(self, index):
return self.images[index], self.labels[index]

class myDataset:
def __init__(self, trainset=None, testset=None) -> None:
def __init__(self, trainset=None, testset=None):
self.customized = True
self.trainset = SddDataset(trainset[0], trainset[1])
self.testset = SddDataset(testset[0], testset[1])

class Estimator:
def __init__(self) -> None:
def __init__(self):
self.model = self.build()
self.pretrained = None
self.saved = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@


class Dataset:
def __init__(self, trainset=None, testset=None) -> None:
def __init__(self, trainset=None, testset=None):
self.customized = True
self.trainset = tf.data.Dataset.from_tensor_slices((trainset.x, trainset.y))
self.trainset = self.trainset.batch(int(Context.get_parameters("batch_size", 32)))
self.testset = tf.data.Dataset.from_tensor_slices((testset.x, testset.y))
self.testset = self.testset.batch(int(Context.get_parameters("batch_size", 32)))

class Estimator:
def __init__(self) -> None:
def __init__(self):
self.model = self.build()
self.pretrained = None
self.saved = None
Expand Down

0 comments on commit 1d1c37b

Please sign in to comment.