Deep Learning from first principles: In vectorized Python, R and Octave