An extension to Torch7's nn package.