Closed RobinKa closed 4 years ago
Branch: https://github.com/RobinKa/tfga/tree/feature/serializable-layers
Create layer base-class GeometricAlgebraLayer
which does the following:
get_config
: only store simple python objects or numpy arrays (for blade indices etc.). Instead of storing the GeometricAlgebra object, we store the metric and later recreate the algebra.from_config
: Recreate GeometricAlgebra from metricAll other GA layers inherit from GeometricAlgebraLayer
and also have the @register_keras_serializable(package="TFGA")
attribute to make them serializable without passing a custom objects dict.
There's still the issue that each layer creates their own GeometricAlgebra
object from the metric. Should be solved by creating only one for each unique metric somehow.
get_config()
needs to return a serializable dict, right now it contains some tensors and other objects which can't be serialized