Transfer of Safety Controllers Through Learning Deep Inverse Dynamics Model