code: def draw_quiver(network_class, name, color="r"):
      """
      Train algorithm and draw quiver for every epoch update
      for this algorithm.
      """
      global weights
      global current_epoch
  
      bpn = network_class(create_network(), signals=save_epoch_weight)
  
      # We don't know in advance number of epochs that network
      # need to reach the goal. For this reason we use 1000 as
      # an upper limit for all network epochs, later we
      # need to fix
      weights = np.zeros((2, 1000))
      weights[:, 0:1] = default_weight.copy()
  
      current_epoch = 0
      while bpn.score(X_train, y_train) > 0.125:
          bpn.train(X_train, y_train, epochs=1)
          current_epoch += 1
  
      weights = weights[:, : current_epoch + 1]
      weight_quiver(weights, color=color)
  
      label = "{name} ({n} steps)".format(name=name, n=current_epoch)
      return mpatches.Patch(color=color, label=label)
  
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 5 for calling a global function with example usage: draw_quiver(network_class, name, color) and returns: mpatches