code: def target_function(optimizer, x, y):
      weight = optimizer.network.layers[1].weight
      new_weight = np.array([[x], [y]])
  
      session = tensorflow_session()
      weight.load(asfloat(new_weight), session)
  
      return optimizer.score(X_train, y_train)
  
file_path: neupy/examples/mlp/gd_algorithms_visualization.py
imports: from functools import partial
  import numpy
  import matplotlib.pyplot
  import matplotlib.patches
  from neupy.utils import asfloat, tensorflow_session
  from neupy import algorithms, layers, utils
label_desc: Use image node_id 6 for calling a global function with example usage: target_function(optimizer, x, y) and returns: optimizer