<jupyter_start><jupyter_text>https://github.com/machrisaa/tensorflow-vgg<jupyter_code>minimize_with_lbfgs(sess, net, optimizer, init_img)
def minimize_with_lbfgs(sess, net, optimizer, init_img):
    if args.verbose: print('\nMINIMIZING LOSS USING: L-BFGS OPTIMIZER')
    init_op = tf.global_variables_initializer()
    sess.run(init_op)
    sess.run(net['input'].assign(init_img))
    optimizer.minimize(sess)


def get_optimizer(loss):
    print_iterations = args.print_iterations if args.verbose else 0
    if args.optimizer == 'lbfgs':
        optimizer = tf.contrib.opt.ScipyOptimizerInterface(
        loss, method='L-BFGS-B',
        options={'maxiter': args.max_iterations,
                  'disp': print_iterations})
    elif args.optimizer == 'adam':
        optimizer = tf.train.AdamOptimizer(args.learning_rate)
    return optimizer

 output_img = sess.run(net['input'])
minimize_with_lbfgs(sess, net, optimizer, init_img)
def minimize_with_lbfgs(sess):
#     if args.verbose: print('\nMINIMIZING LOSS USING: L-BFGS OPTIMIZER')
#     init_op = tf.global_variables_initializer()
#     sess.run(init_op)
    sess.run(net['input'].assign(init_img))
    optimizer.minimize(sess)


def get_optimizer(self):
#     print_iterations = args.print_iterations if args.verbose else 0
    if self.opp == 'lbfgs':
        self.optimizer = tf.contrib.opt.ScipyOptimizerInterface(
        self.total_loss, method='L-BFGS-B',
        options={'maxiter': 10})
        self.optimizer

output_img = sess.run(net['input'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1270252754374595, 'fraction_numerical': 0.002592352559948153, 'mean_word_length': 4.078947368421052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '316394', 'license': 'MIT', 'n_tokens_mistral': 571, 'n_tokens_neox': 554, 'n_words': 87, 'path': 'VGG19.ipynb', 'repo_name': 'nile649/Style-Transfer', 'size': '1543'}