add an option to use loss.hoss from 'variable' as well as 'state'