From 472b576a1451aac00920a4282e809cc8c344fda1 Mon Sep 17 00:00:00 2001 From: nmcardoso Date: Wed, 23 Aug 2023 05:52:28 +0000 Subject: [PATCH] deploy: 6abefc52201ad598d6d4dd195c23d25fed9ef030 --- _modules/mergernet/estimators/parametric.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/_modules/mergernet/estimators/parametric.html b/_modules/mergernet/estimators/parametric.html index d22d89c6..1ab7322a 100644 --- a/_modules/mergernet/estimators/parametric.html +++ b/_modules/mergernet/estimators/parametric.html @@ -584,14 +584,18 @@

Source code for mergernet.estimators.parametric

< # Classifier for i in range(1, 4): - if self.hp.get(f'dense_{i}_units'): - x = tf.keras.layers.Dense(self.hp.get(f'dense_{i}_units'))(x) - if self.hp.get(f'batch_norm_{i}'): + units = self.hp.get(f'dense_{i}_units') + bn = self.hp.get(f'batch_norm_{i}') + activation = self.hp.get(f'activation_{i}', default='relu') + dropout_rate = self.hp.get(f'dropout_{i}_rate') + if units: + x = tf.keras.layers.Dense(units, use_bias=not bn)(x) + if bn: x = tf.keras.layers.BatchNormalization()(x) - if self.hp.get(f'activation_{i}', default='relu') == 'relu': + if activation == 'relu': x = tf.keras.layers.Activation('relu')(x) - if self.hp.get(f'dropout_{i}_rate'): - x = tf.keras.layers.Dropout(self.hp.get(f'dropout_{i}_rate'))(x) + if dropout_rate: + x = tf.keras.layers.Dropout(dropout_rate)(x) # Classifications outputs = tf.keras.layers.Dense(self.dataset.config.n_classes, activation='softmax')(x)