add register_keras_serializable

This commit is contained in:
Giuseppe Nucifora 2024-12-11 04:19:59 +01:00
parent 32cc73f90f
commit 473419e7c1

View File

@ -1421,6 +1421,7 @@
" decay_steps=7000 # Aumentato per permettere più esplorazione\n", " decay_steps=7000 # Aumentato per permettere più esplorazione\n",
" )\n", " )\n",
"\n", "\n",
" @keras.saving.register_keras_serializable()\n",
" def weighted_huber_loss(y_true, y_pred):\n", " def weighted_huber_loss(y_true, y_pred):\n",
" # Pesi per diversi output\n", " # Pesi per diversi output\n",
" weights = tf.constant([1.0, 0.8, 0.8, 1.0, 0.6], dtype=tf.float32)\n", " weights = tf.constant([1.0, 0.8, 0.8, 1.0, 0.6], dtype=tf.float32)\n",