added some special purpose functions for neuralnets to linalg