<commit_before>import tensorflow as tf
import time

(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()

x_train = x_train.reshape([x_train.shape[0], -1])
x_train = x_train.astype('float32') / 255
y_train = tf.keras.utils.to_categorical(y_train, num_classes=10)

x_test = x_test.reshape([x_test.shape[0], -1])
x_test = x_test.astype('float32') / 255
y_test = tf.keras.utils.to_categorical(y_test, num_classes=10)

batch_size = 128
epochs = 30
learning_rate = 1

# input place holders
X = tf.placeholder(tf.float32, [None, 784])
Y = tf.placeholder(tf.float32, [None, 10])

# weights & bias for perceptron
W1 = tf.Variable(tf.random_uniform([784, 512], minval=-0.01, maxval=0.01))
b1 = tf.Variable(tf.zeros([512]))
L1 = tf.sigmoid(tf.matmul(X, W1) + b1)

W2 = tf.Variable(tf.random_uniform([512, 512], minval=-0.01, maxval=0.01))
b2 = tf.Variable(tf.zeros([512]))<commit_msg>Update Tensorflow.py<commit_after>import tensorflow as tf
import time

(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()

x_train = x_train.reshape([x_train.shape[0], -1])
x_train = x_train.astype('float32') / 255
y_train = tf.keras.utils.to_categorical(y_train, num_classes=10)

x_test = x_test.reshape([x_test.shape[0], -1])
x_test = x_test.astype('float32') / 255
y_test = tf.keras.utils.to_categorical(y_test, num_classes=10)

batch_size = 128
epochs = 30
learning_rate = 1

# input place holders
X = tf.placeholder(tf.float32, [None, 784])
Y = tf.placeholder(tf.float32, [None, 10])

# weights & bias for neural networks
W1 = tf.Variable(tf.random_uniform([784, 512], minval=-0.01, maxval=0.01))
b1 = tf.Variable(tf.zeros([512]))
L1 = tf.sigmoid(tf.matmul(X, W1) + b1)

W2 = tf.Variable(tf.random_uniform([512, 512], minval=-0.01, maxval=0.01))
b2 = tf.Variable(tf.zeros([512]))
{'fraction_non_alphanumeric': 0.1712860310421286, 'fraction_numerical': 0.07760532150776053, 'mean_word_length': 5.4928057553956835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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}}
{'dir': 'git-commits-cleaned', 'id': '2482898', 'n_tokens_mistral': 843, 'n_tokens_neox': 763, 'n_words': 137}