Skip to content

Commit f793bc2

Browse files
Update Unet.py
CompileAndSummarizeModel() - Added parameters to the function with default values.
1 parent c323073 commit f793bc2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Unet.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,24 @@ def Build_UNetwork(self):
8181

8282
return model
8383

84-
def CompileAndSummarizeModel(self, model):
84+
def CompileAndSummarizeModel(self, model, optimizer = "adam", loss = "binary_crossentropy"):
8585

8686
"""
8787
Compiles and displays the model summary of the Unet model.
8888
8989
Args:
9090
model: The Unet model.
91-
91+
optimizer: model optimizer. Default is the adam optimizer.
92+
loss: the loss function. Default is the binary cross entropy loss.
93+
9294
Return:
9395
None
9496
9597
"""
96-
model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["acc"])
98+
model.compile(optimizer = optimizer, loss = loss, metrics = ["acc"])
9799
model.summary()
98100

99-
def plotModel(self, model, to_file='unet.png', show_shapes=True, dpi=96):
101+
def plotModel(self, model, to_file = 'unet.png', show_shapes = True, dpi = 96):
100102

101103
"""
102104
Saves the Unet model to a file.

0 commit comments

Comments
 (0)