Skip to content

Commit b067751

Browse files
committed
Handle non-homogeneous lists
1 parent 9a0d589 commit b067751

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

aeon/clustering/deep_learning/_ae_fcn.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -367,20 +367,16 @@ def loss(y_true, y_pred):
367367
if _name.startswith("__act_decoder"):
368368
_decoder_intermediate_outputs.append(_prop)
369369

370-
_encoder_intermediate_outputs = tf.stack(_encoder_intermediate_outputs)
371-
_decoder_intermediate_outputs = tf.stack(_decoder_intermediate_outputs)
372-
373370
if not (
374371
len(_encoder_intermediate_outputs)
375372
== len(_decoder_intermediate_outputs)
376373
):
377374
raise ValueError("The Auto-Encoder must be symmetric in nature.")
378375

379-
mse += K.mean(
380-
K.square(
381-
_encoder_intermediate_outputs - _decoder_intermediate_outputs
382-
)
383-
)
376+
for enc_output, dec_output in zip(
377+
_encoder_intermediate_outputs, _decoder_intermediate_outputs
378+
):
379+
mse += K.mean(K.square(enc_output - dec_output))
384380

385381
return mse
386382

0 commit comments

Comments
 (0)