more type info in loss_and_reg.jl