class_docstr: Class that sets up and runs the optimization of dual_formulation
class_docstr_tok: ["Class","that","sets","up","and","runs","the","optimization","of","dual_formulation"]
docstr: Initialize the class variables.
  
  Args:
    dual_formulation_object: Instance of DualFormulation that contains the
      dual variables and objective
    sess: tf session to be used to run
    optimization_params: Dictionary with the following
      eig_num_iter - Number of iterations to run for computing minimum eigen
        value
      eig_learning_rate - Learning rate for minimum eigen value iterations
      init_smooth - Starting value of the smoothness parameter (typically
      around 0.001)
      smooth_decay - The factor by which to decay after every outer loop epoch
      optimizer - one of gd, adam, momentum or adagrad
      eig_type - The method to compute eigenvalues (TF or SCIPY)
docstr_tok: ["Initialize","the","class","variables",".","Args",":","dual_formulation_object",":","Instance","of","DualFormulation","that","contains","the","dual","variables","and","objective","sess",":","tf","session","to","be","used","to","run","optimization_params",":","Dictionary","with","the","following","eig_num_iter","-","Number","of","iterations","to","run","for","computing","minimum","eigen","value","eig_learning_rate","-","Learning","rate","for","minimum","eigen","value","iterations","init_smooth","-","Starting","value","of","the","smoothness","parameter","(","typically","around","0.001",")","smooth_decay","-","The","factor","by","which","to","decay","after","every","outer","loop","epoch","optimizer","-","one","of","gd",",","adam",",","momentum","or","adagrad","eig_type","-","The","method","to","compute","eigenvalues","(","TF","or","SCIPY",")"]
code: def __init__(
      self, dual_formulation_object, sess, optimization_params
  ):
      """Initialize the class variables.
  
      Args:
        dual_formulation_object: Instance of DualFormulation that contains the
          dual variables and objective
        sess: tf session to be used to run
        optimization_params: Dictionary with the following
          eig_num_iter - Number of iterations to run for computing minimum eigen
            value
          eig_learning_rate - Learning rate for minimum eigen value iterations
          init_smooth - Starting value of the smoothness parameter (typically
          around 0.001)
          smooth_decay - The factor by which to decay after every outer loop epoch
          optimizer - one of gd, adam, momentum or adagrad
          eig_type - The method to compute eigenvalues (TF or SCIPY)
      """
      self.sess = sess
      self.dual_object = dual_formulation_object
      self.params = optimization_params
      self.penalty_placeholder = tf.placeholder(tf.float32, shape=[])
  
      # The dimensionality of matrix M is the sum of sizes of all layers + 1
      # The + 1 comes due to a row and column of M representing the linear terms
      self.eig_init_vec_placeholder = tf.placeholder(
          tf.float32, shape=[1 + self.dual_object.dual_index[-1], 1]
      )
      self.smooth_placeholder = tf.placeholder(tf.float32, shape=[])
      self.eig_num_iter_placeholder = tf.placeholder(tf.int32, shape=[])
      self.current_eig_val_estimate = None
  
      # Create graph for optimization
      self.prepare_for_optimization()
  
file_path: cleverhans/cleverhans/experimental/certification/optimization.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  import numpy
  from scipy.sparse.linalg import eigs, LinearOperator
  import tensorflow
  from tensorflow.contrib import autograph
  from cleverhans.experimental.certification import utils
label_desc: Use image node_id 1 to create a new Optimization object from inherited base classes: object with example: obj = Optimization(dual_formulation_object, sess, optimization_params)