ref: https://optax.readthedocs.io/en/latest/api/losses.html#optax.cosine_similarity
ref: https://optax.readthedocs.io/en/latest/api/losses.html#optax.cosine_similarity