How to define cost function for custom nonlinear functions?

For logistic regression, the Cost function is defined as: $$$$Cost(h_{\theta}(x)-y) = -ylog(h_{\theta}(x))-(1-y)log(1-h_{\theta}(x))$$$$

I now have a nonlinear function $$$$h_{\theta}^{(i)}(x)=xe^{-j\theta_i|x|^2}$$$$ where $$i$$ denotes the $$i$$th training sample. How should I define cost function for this particular nonlinear function?