<img width="948" alt="image" src="https://github.com/lucidrains/vector-quantize-pytorch/assets/15104876/074de9af-601e-4767-a9bd-61dfc80cbb1c"> Your implementation on bound function might be incorrect. tan() is not the inverse of tanh().