Config in Time2Vec layer is not serializable.
Test code:
model = time2vec_lstm(SEQ_LEN, 16)
model.compile(
loss=tf.keras.losses.mean_squared_error,
optimizer=tf.keras.optimizers.Adam(learning_rate=1e-3)
)
# Retrieve the config
config = model.get_config()
Gives the following error:
NotImplementedError:
Layer Time2Vec has arguments ['self', 'kernel_size', 'periodic_activation']
in `__init__` and therefore must override `get_config()`.
Example:
class CustomLayer(keras.layers.Layer):
def __init__(self, arg1, arg2):
super().__init__()
self.arg1 = arg1
self.arg2 = arg2
def get_config(self):
config = super().get_config()
config.update({
"arg1": self.arg1,
"arg2": self.arg2,
})
return config
Config in Time2Vec layer is not serializable.
Test code:
Gives the following error: