model_segmentation: spare → normal crossentropy, activation functions at end

This commit is contained in:
Starbeamrainbowlabs 2022-11-10 20:53:37 +00:00
parent b6676e7361
commit 9384b89165
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -44,8 +44,8 @@ def model_rainfallwater_segmentation(metadata, shape_water_out, model_arch="conv
# TODO: An attention layer here instead of a dense layer, with a skip connection perhaps?
logger.warning("Warning: TODO implement attention from https://ieeexplore.ieee.org/document/9076883")
layer_next = tf.keras.layers.Dense(32)(layer_next)
layer_next = tf.keras.layers.Conv2D(water_bins, kernel_size=1, padding="same")(layer_next)
layer_next = tf.keras.layers.Dense(32, activation="relu")(layer_next)
layer_next = tf.keras.layers.Conv2D(water_bins, activation="relu", kernel_size=1, padding="same")(layer_next)
layer_next = tf.keras.layers.Softmax(axis=-1)(layer_next)
model = tf.keras.Model(