FlashFloodTrustNet / custom_objects.py
sharktide's picture
Create custom_objects.py
bb49d2d verified
raw
history blame contribute delete
343 Bytes
from tensorflow.keras.saving import register_keras_serializable
from tensorflow.keras import layers, models, backend as K
import tensorflow as tf
@register_keras_serializable()
def trust_activation(x):
return 0.5 + tf.sigmoid(x)
CUSTOM_OBJECTS = {
'trust_activation': trust_activation,
'mse': tf.keras.losses.MeanSquaredError()
}