File size: 376 Bytes
d39e5f7
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import tensorflow as tf
from tensorflow.keras.saving import register_keras_serializable
from tensorflow.keras import layers, models, backend as K
import numpy as np

@register_keras_serializable()
def floodtrust_activation(x):
    return 0.5 + tf.sigmoid(x)

CUSTOM_OBJECTS = {
    "floodtrust_activation": floodtrust_activation,
    "mse": tf.keras.losses.MeanSquaredError
}