In keras / tensorflow it is often quite simple to describe layers directly as functions that map their input to an output, like so: