import tensorflow as tf

tf.scalar_summary('nll', nll)

init_op = tf.initialize_all_variables()

# from http://stackoverflow.com/a/35907755/1199693
config = tf.ConfigProto(graph_options=tf.GraphOptions(
    # optimizer_options=tf.OptimizerOptions(opt_level=tf.OptimizerOptions.L2))) # L2 werkt niet (wrs eruit gehaald)
    optimizer_options=tf.OptimizerOptions(opt_level=tf.OptimizerOptions.L1)))

# start session
with tf.Session(config=config) as sess:
    # Merge all the summaries and write them out to /tmp/mnist_logs (by default)
    summarize_merged = tf.merge_all_summaries()
    summary_writer = tf.train.SummaryWriter('./train/%i' % int(time.time()), sess.graph)
    # Run the init operation.
    sess.run(init_op)

    true_vars = {}
    for v in variables:
        key = v.name[:v.name.find(':')]
        true_vars[key] = v.eval()

    true_vars['m0'] = m0.eval()

