| 251 | |
| 252 | #CIRCULAR LAYER FOR THE AUTOENCODER |
| 253 | class Circularize(tfkl.Layer): |
| 254 | def __init__(self, input_dim=1): |
| 255 | super(Circularize, self).__init__() |
| 256 | |
| 257 | def call(self, inputs): |
| 258 | return tf.concat([tf.math.cos(2*np.pi*inputs),tf.math.sin(2*np.pi*inputs)], axis=1) |
| 259 | |
| 260 | |
| 261 | sys.stdout.write("[Loading anndata]: ") |