Skip to content
Snippets Groups Projects
Commit f3ce92d9 authored by Nikolai's avatar Nikolai
Browse files

allow both None and 0 for deactivating dropout

parent 0519ccd8
No related branches found
No related tags found
No related merge requests found
...@@ -623,7 +623,7 @@ class ClassificationProject(object): ...@@ -623,7 +623,7 @@ class ClassificationProject(object):
# the (other) hidden layers # the (other) hidden layers
for node_count, dropout_fraction in zip(self.nodes[start_layer:], self.dropout[start_layer:]): for node_count, dropout_fraction in zip(self.nodes[start_layer:], self.dropout[start_layer:]):
self._model.add(Dense(node_count, activation=self.activation_function)) self._model.add(Dense(node_count, activation=self.activation_function))
if dropout_fraction > 0: if (dropout_fraction is not None) and (dropout_fraction > 0):
self._model.add(Dropout(rate=dropout_fraction)) self._model.add(Dropout(rate=dropout_fraction))
# last layer is one neuron (binary classification) # last layer is one neuron (binary classification)
self._model.add(Dense(1, activation=self.activation_function_output)) self._model.add(Dense(1, activation=self.activation_function_output))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment