# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python [conda env:tf]
#     language: python
#     name: conda-env-tf-py
# ---

# +
import tensorflow as tf

from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)

# +
tf.reset_default_graph()

images, labels = mnist.train.next_batch(256)

weights1 = tf.get_variable("weights1", (784, 100))
layer1 = tf.nn.relu(images @ weights1)

weights2 = tf.get_variable("weights2", (100, 100))
layer2 = tf.nn.relu(layer1 @ weights2)

weights3 = tf.get_variable("weights3", (100, 10))
outputs = layer2 @ weights3

loss = tf.losses.softmax_cross_entropy(labels, outputs)

train_op = tf.train.AdamOptimizer().minimize(loss)

total_steps = 100
with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    for step in range(total_steps):
        sess.run([train_op])

StarcoderdataJupyterScriptsDedupFiltered