Construction and evaluation of embedding functions