With neurons as its primary computational components, the brain operates at multiple timescales. In this thesis, we focus on two timescales: on a relatively slow timescale on the order of hours to days, the brain adapts to the environment it is exposed to and learns its circuitry by altering the...