How to calculate compression ratio when using autoencoder in neural network
Usually the compression ratio is measured on the files. So the correct way of computing it is to calculate the size of you data before compression, run them through the AE, store them to your drive and then see how much size they occupy after compression.

Then simply divide the two:

$$
Compression \; Ratio = \frac{Uncompressed \; Size}{Compressed \; Size}
$$

Theoretically in your case this should give a 40:1 compression ratio, but, due to overhead and the way you store your data it might not be so high.