Add exception class.
Add API documentation for optimizers.
Document activation functions.
Add preprocessing function.
Check dimensions.
Update documentation.