Skip to content

Instantly share code, notes, and snippets.

@avisheknag17
Created June 12, 2021 10:02
Show Gist options
  • Save avisheknag17/e51bb802e21aee6a060b7789757bf4e8 to your computer and use it in GitHub Desktop.
Save avisheknag17/e51bb802e21aee6a060b7789757bf4e8 to your computer and use it in GitHub Desktop.
import numpy as np
def costly_function(x):
total = np.array([])
for x_i in x:
total = np.append(total, np.sum(np.exp(-(x_i - 5) ** 2)))
return total + np.random.randn()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment