ClimateStrike AI
Collection
CliamateStrike AI: A High-Precision AI Framework for Early Detection of Natural Disasters • 14 items • Updated • 1
How to use sharktide/FV-FloodTrustNet with Keras:
# !pip install -U keras tensorflow huggingface_hub
# Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here;
# "jax" and "torch" also work for computation once TensorFlow is installed.
import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras
model = keras.saving.load_model("hf://sharktide/FV-FloodTrustNet")
This model requires the following custom objects:
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) # output in range [0.5, 1.5]