<jupyter_start><jupyter_text>TF Neural Network<jupyter_code>import numpy as np
import tensorflow as tf

np.random.seed(101)
tf.set_random_seed(101)
rand_a = np.random.uniform(0,100,(5,5))
rand_a
rand_b = np.random.uniform(0,100,(5,1))
rand_b
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
add_op = a + b
mul_op = a * b
with tf.Session() as sess:
    add_result = sess.run(add_op,feed_dict={a:10,b:20})
    print(add_result)
    add_result = sess.run(add_op,feed_dict={a:rand_a,b:rand_b})
    print(add_result)
    mul_result = sess.run(mul_op,feed_dict={a:rand_a,b:rand_b})
    print(mul_result)<jupyter_output>30.0
[[151.07166  156.49855  102.27921  116.58396  167.95949 ]
 [135.45622   82.76316  141.42784  124.22093   71.06043 ]
 [113.30171   93.09215   76.06819  136.43912  154.42728 ]
 [ 96.71727   81.83804  133.83675  146.38118  101.10579 ]
 [122.72681  105.982925  59.044632  67.9831    72.89292 ]]
[[5134.644   5674.25     283.12433 1705.4707  6813.8315 ]
 [4341.8125  1598.267   4652.734   3756.8293   988.94635]
 [3207.8113  2038.1029  1052.7742  4546.9805  5588.1157 ]
 [1707.379    614.02527 4434.989   5356.7773  2029.8555 ]
 [3714.0984  2806.6438   262.76764  747.19855 1013.292  ]]<jupyter_text>Exmple Neural Network<jupyter_code>n_features = 10
n_dense_neurons = 3
x = tf.placeholder(tf.float32,shape=(None,n_features))
W = tf.Variable(tf.random_normal([n_features,n_dense_neurons]))
b = tf.Variable(tf.ones([n_dense_neurons]))
Wx = tf.matmul(x,W)
z = tf.add(Wx,b)
sig = tf.sigmoid(z)
rel = tf.nn.relu(z)
init = tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init)
    sig_out = sess.run(sig,feed_dict={x:np.random.random([1,n_features])})
    rel_out = sess.run(rel,feed_dict={x:np.random.random([1,n_features])})
print(sig_out)
print('\n')
print(rel_out)<jupyter_output>[[0.20632724 0.77029413 0.1256159 ]]


[[0.        1.9694904 0.7052403]]
{'fraction_non_alphanumeric': 0.15186547556489752, 'fraction_numerical': 0.24330005254860745, 'mean_word_length': 4.202185792349726, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '344488', 'license': 'Apache-2.0', 'n_tokens_mistral': 1135, 'n_tokens_neox': 858, 'n_words': 130, 'path': '00-BasicSyntax/.ipynb_checkpoints/04_NeuralNetwork-checkpoint.ipynb', 'repo_name': 'prasadrlv/TensorFlow', 'size': '1903'}