Add input validation and input conversion for the gradient factor settings. Signed-off-by: Michael Keller <mikeller@042.ch>