code: def run():
      priv = np.zeros((100, 32, 32, 3))
      uusing = np.array(using)
      lams = np.array(lambdas)
  
      # Use Adam, because thinking hard is overrated we have magic pixie dust.
      (
          init_1,
          opt_update_1,
          get_params_1,
      ) = jax.example_libraries.optimizers.adam(0.01)
  
      @jax.jit
      def update_1(i, opt_state, gs):
          return opt_update_1(i, gs, opt_state)
  
      opt_state_1 = init_1(priv)
  
      # 1000 iterations of gradient descent is probably enough
      for i in range(1000):
          value, grad = vg(priv, lams, i)
  
          if i % 100 == 0:
              print(value)
  
              var, _, _ = explained_variance(
                  0,
                  priv,
                  jn.array(lambdas),
                  jn.array(encoded),
                  jn.array(using),
                  return_mat=True,
              )
              print("unexplained min/max", var.min(), var.max())
          opt_state_1 = update_1(i, opt_state_1, grad[0])
          priv = opt_state_1.packed_state[0][0]
  
      priv -= np.min(priv, axis=(1, 2, 3), keepdims=True)
      priv /= np.max(priv, axis=(1, 2, 3), keepdims=True)
      priv *= 2
      priv -= 1
  
      # Finally save the stored values
      np.save("data/private_raw.npy", priv)
  
file_path: privacy/research/instahide_attack_2020/step_5_reconstruct.py
imports: import json
  import numpy
  import jax.numpy
  import jax
  import collections
  from PIL import Image
  import jax.example_libraries.optimizers
  import matplotlib.pyplot
label_desc: Use image node_id 6 for calling a global function with example usage: run() and returns: opt_update_1